home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / door / gapcdr.zip / GAPCDR.TXT < prev    next >
Text File  |  1992-01-12  |  154KB  |  5,167 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.                          GAP Communications Online Software
  29.  
  30.  
  31.  
  32.  
  33.                                        GAPCDR
  34.  
  35.                                Door Interface Library
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.           Copyright (C) 1987-1992 by GAP Development Company.
  43.  
  44.  
  45.           ALL RIGHTS  RESERVED. No part of this manual shall be reproduced,
  46.           stored in  a retrieval  system,  or  transmitted  by  any  means,
  47.           electronic, mechanical,  photocopying, recording,  or  otherwise,
  48.           without written  permission from  GAP Development  Company. While
  49.           every precaution  has been  taken  in  the  preparation  of  this
  50.           manual, GAP  Development Company  assumes no  responsibility  for
  51.           errors or omissions. Neither is any liability assumed for damages
  52.           resulting from the use of the information contained herein.
  53.  
  54.  
  55.           GAPCDR is  the sole  and exclusive  property of  GAP  Development
  56.           Company. It  is licensed  and not  sold  to  the  end  user  with
  57.           restrictions placed upon its use.
  58.  
  59.  
  60.           GAPCDR is copyrighted by GAP Development Company.
  61.           DESQview is a trademark of Quarterdeck.
  62.           PCBoard is a trademark of Clark Development Corporation.
  63.           WildCat! is copyrighted by Mustang Software.
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.           Contents
  71.  
  72.  
  73.  
  74.           Description                                                     5
  75.  
  76.                Major Features                                             5
  77.  
  78.  
  79.           Getting Started                                                 7
  80.  
  81.                Supported Compilers                                        8
  82.                Using GAPCDR                                               8
  83.                Points To Remember                                        10
  84.                Compiling And Linking                                     11
  85.                Using A Goto                                              12
  86.                BBS System Files                                          13
  87.  
  88.  
  89.           Sysop Setup And Functions                                      13
  90.  
  91.                Configuration                                             14
  92.                Sysop Functions                                           15
  93.  
  94.  
  95.           Advanced Applications                                          16
  96.  
  97.                Communications                                            16
  98.                DOS Window                                                18
  99.  
  100.  
  101.           Variables                                                      20
  102.  
  103.                Defines                                                   20
  104.                Ansi Variables                                            20
  105.                DOOR.SYS Variables                                        21
  106.                Global Variables                                          23
  107.  
  108.  
  109.           Functions - Quick Reference                                    25
  110.  
  111.  
  112.  
  113.           Functions - Detailed Reference                                 26
  114.  
  115.  
  116.  
  117.           Index                                                          79
  118.  
  119.  
  120.  
  121.                                        Page 3
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.                                        Page 4
  180.  
  181.  
  182.  
  183.           GAP Communications                                         GAPCDR
  184.  
  185.  
  186.  
  187.  
  188.           Description          Description
  189.  
  190.  
  191.           GAPCDR is  a professional development kit for Bulletin Board Door
  192.           programmers. Written in Microsoft C version 6 and MASM version 6,
  193.           it is  fast, reliable,  easy to use, and easy to incorporate into
  194.           the serious  programmer's source  code. It consists of a set of C
  195.           and assembler library routines to allow for easy door programming
  196.           and interfacing. Borland C compatability is included.
  197.  
  198.  
  199.           Major Features          Major Features
  200.  
  201.              Interfaces with  GAP Communications,  PCBoard, WildCat, and
  202.              other fine  BBS programs  that are  capable  of  writing  a
  203.              DOOR.SYS file.
  204.  
  205.              Full communications support.
  206.  
  207.              Supports the FIFO buffers of the 16550 UART chip.
  208.  
  209.              Speeds up to 115,200 baud.
  210.  
  211.              Communications ports other than Com 1 and Com 2 possible.
  212.  
  213.              Supports CTS/RTS, automatically.
  214.  
  215.              Does not require watchdog or CTTY.
  216.  
  217.              Fully self contained, built in ANSI driver.
  218.  
  219.              Sysop sees what the caller sees.
  220.  
  221.              High speed text file display.
  222.  
  223.              Supports  ANSI   color  and   ASCII  text   files  with  no
  224.              programming effort  other than  to make  a single  function
  225.              call.
  226.  
  227.              Easy to use Random Number Generator.
  228.  
  229.              Informative Status Line display.
  230.  
  231.              Monitors keyboard activity and caller time remaining.
  232.  
  233.              Easy interface to BBS system.
  234.  
  235.  
  236.  
  237.                                        Page 5
  238.  
  239.  
  240.  
  241.           GAP Communications                                         GAPCDR
  242.  
  243.  
  244.              Sysop chat with full word wrapping.
  245.  
  246.              Allows the sysop to shell to DOS.
  247.  
  248.              "Remembers" the  default drive and directory which prevents
  249.              file access errors.
  250.  
  251.              Credits caller  with time  spent chatting or while sysop is
  252.              in a DOS shell.
  253.  
  254.              Sysop can twit caller without caller ever knowing the sysop
  255.              is watching.
  256.  
  257.              Caller time can be increased or decreased.
  258.  
  259.              Full programmer control of whether or not to update the BBS
  260.              system files.
  261.  
  262.              Time calculations  are not  dependent on the "seconds since
  263.              midnight" and  are thus  unsusceptible to the midnight roll
  264.              over.
  265.  
  266.              Timer routines are hardware independent.
  267.  
  268.              Automatic detection of multi-user system.
  269.  
  270.              Input routines are consistent throughout the program.
  271.  
  272.              Uses the latest in Microsoft C and MASM features.
  273.  
  274.              Extremely easy interfacing to door programs.
  275.  
  276.              Fully DESQView aware video routines as well as keyboard and
  277.              COM input routines, and COM output routines.
  278.  
  279.  
  280.  
  281.           GAPCDR includes  robust Communications  routines which  are fully
  282.           interrupt driven. Written in highly optimized assembler, they are
  283.           capable of  operating at  any speed which the UART on an IBM type
  284.           of computer  is capable  of producing.  The FIFO  buffers in  the
  285.           16550 UART  are fully  supported. CTS/RTS  checking is automatic,
  286.           and  carrier   detect  is   an  integral  part  of  each  of  the
  287.           communications input and output routines. When there is a loss of
  288.           carrier, a  function in the main GAPCDR code will be called. This
  289.           function defaults  to shutting down the door and returning to the
  290.           BBS, however you may modify it to do whatever you wish.
  291.  
  292.  
  293.  
  294.  
  295.                                        Page 6
  296.  
  297.  
  298.  
  299.           GAP Communications                                         GAPCDR
  300.  
  301.  
  302.           The built  in ANSI driver makes GAPCDR a self contained unit. The
  303.           driver is  smart enough  to know when a caller does not want ANSI
  304.           sequences sent  to his  computer and  it will filter out any such
  305.           codes that  pass through  it. This  allows you  to create prompts
  306.           with embedded  ANSI sequences  and display them without regard as
  307.           to whether  or not  the caller  has color  "turned on". This also
  308.           means you do not have to keep two sets of prompts (one with color
  309.           attributes and  one without).  This is  a great savings to you in
  310.           precious DATA  space. You  may also  use the  ANSI driver to send
  311.           color strings to the local monitor. Even if the caller is in mono
  312.           mode, you  may still  send color  strings and prompts to the ANSI
  313.           driver and have them displayed in color on the local monitor.
  314.  
  315.           GAPCDR supports  only the  DOOR.SYS  format  for  passing  caller
  316.           information to  a door.  We choose  this format  because  of  its
  317.           universal acceptance  and its  inherent ability to remain stable.
  318.           BBS programs  frequently change  and with  those changes  usually
  319.           come modifications  to the  system files  they create to interact
  320.           with door  programs. DOOR.SYS  on the  other hand was designed to
  321.           include as  much  information  about  a  caller  as  was  thought
  322.           necessary. Should  new fields  be needed  to take care of new BBS
  323.           features, it  is a  simple matter  to add these new fields to the
  324.           end of  the file,  thereby making the new version compatible with
  325.           all prior versions. Most major BBS programs support DOOR.SYS.
  326.  
  327.  
  328.  
  329.           Getting Started          Getting Started
  330.  
  331.  
  332.           GAPCDR is  distributed in  archived format.  The contents  of the
  333.           archive should be as follows:
  334.  
  335.             GAPCDR.TXT      - Disk based documentation.
  336.             GAPCDRS.LIB     - Small model Library routines.
  337.             GAPCDRL.LIB     - Large model Library routines.
  338.             GAPCDRBS.LIB    - Small model Library routines for BC.
  339.             GAPCDRBL.LIB    - Large model Library routines for BC.
  340.             GAPCDR.H        - Door Interface include file.
  341.             GAPSTRUC.H      - Door Interface include file.
  342.             CDOOR.ZIP       - Sample program  illustrating many  of the
  343.                               features of GAPCDR.
  344.             READ.ME         - Any  pertinent   information  which   you
  345.                               should read.
  346.  
  347.  
  348.           If you  licensed the  source code to GAPCDR you will receive most
  349.           of the ASM, C, INC, H, BAT, and OBJ files that make up the GAPCDR
  350.  
  351.  
  352.  
  353.                                        Page 7
  354.  
  355.  
  356.  
  357.           GAP Communications                                         GAPCDR
  358.  
  359.  
  360.           library. We  include both  Microsoft and  Borland batch  files to
  361.           compile the source modules.
  362.  
  363.  
  364.           Supported Compilers          Supported Compilers
  365.  
  366.           We used  the Microsoft  C compiler  version 6.0,  the Borland C++
  367.           Compiler  version  2.0,  and  MASM  version  6.  The  linker  and
  368.           librarian were from their respective compilers.
  369.  
  370.           Since GAPCDR  uses no  floating point  math, the  C modules  were
  371.           compiled with  the /FPa switch for Microsoft. This is the default
  372.           for Borland,  so no  switches are  necessary. For Microsoft C, in
  373.           order to  use the  /FPa switch,  you must  tell the SETUP program
  374.           that you  want to create the Alternate Floating Point library. It
  375.           will then  create a  set of  libraries that  make  calls  to  the
  376.           Alternate Math  library instead  of  the  Emulator  Library.  The
  377.           difference in  code size  for a large model program that uses the
  378.           Alternate library as opposed to the Emulator library is typically
  379.           around 10k.  Even if  you do not use floating point arithmetic in
  380.           your program, the Math Library will still be linked in because it
  381.           contains the  routines to do long arithmetic. So, the smaller the
  382.           library, the smaller your programs!
  383.  
  384.           Place the  GAPCDR files in your work directory. You may place the
  385.           LIB files in the MSC\LIB or BORLAND\LIB directory.
  386.  
  387.           The text  editor you  use must  allow control  characters  to  be
  388.           entered and  displayed. The  ANSI variables  are initialized with
  389.           literal characters  and if  your editor removes the ESC character
  390.           from the strings, your ANSI displays will be quite messy.
  391.  
  392.  
  393.           Using GAPCDR          Using GAPCDR
  394.  
  395.           At the  very beginning  of your  program, you  must  include  the
  396.           GAPCDR.H file.  Without this  file,  nothing  will  work.  It  is
  397.           normally included  after the C header files that your program may
  398.           need. To include the file, you type the following after including
  399.           the regular C header files:
  400.  
  401.                #include "gapcdr.h"
  402.  
  403.           GAPCDR.H  contains  the  declarations  for  the  external  global
  404.           variables. In addition, it includes GAPSTRUC.H which contains the
  405.           structure declarations and the function prototypes.
  406.  
  407.  
  408.  
  409.  
  410.  
  411.                                        Page 8
  412.  
  413.  
  414.  
  415.           GAP Communications                                         GAPCDR
  416.  
  417.  
  418.                Note: Any  of your source modules that include GAPCDR.H
  419.                must have  an include  declaration for STDIO.H prior to
  420.                including GAPCDR.H.  It should  be standard practice to
  421.                include STDIO.H  in your source modules anyway, so this
  422.                shouldn't present any problems.
  423.  
  424.           The first  thing that must be done prior to using any of the door
  425.           functions, is  to initialize  GAPCDR itself. This is accomplished
  426.           by making  a call  to read_cnf.  Read_cnf opens the configuration
  427.           file (the  name of  which you  pass as  a parameter  on the  door
  428.           command line)  and reads the first four lines of the file. If the
  429.           configuration file  cannot be  found, the  program will  end. The
  430.           format of the configuration file is as follows:
  431.  
  432.  
  433.  
  434.                            c:\gap
  435.                            The Crow's Nest
  436.                            0
  437.                            0
  438.  
  439.  
  440.           The first  line of  the file  is the  path  to  the  BBS  default
  441.           directory. The second line is the name of the BBS. The third line
  442.           is the Port IRQ and the 4th line is the Port Base Address. If the
  443.           sysop running  your program  has his  BBS configured  to use  Com
  444.           Ports other  than 1  or 2,  he would  then enter the IRQ and Base
  445.           address for  his Com  Port on  lines 3  and 4. GAPCDR derives the
  446.           Port Number from the DOOR.SYS file.
  447.  
  448.           The configuration  file is  usually given  a name  similar to the
  449.           name of  your door  program, with  a CNF extension. Read_cnf will
  450.           leave this  file open for your use. If you have any configuration
  451.           options of  your own,  you may  place them in this file beginning
  452.           with line  5. Do  not read your configuration options until after
  453.           making a  call to  init_door (which should be the second function
  454.           call in  your program).  Upon return from init_door, you are free
  455.           to read  your configuration  options (if  any). At this time, you
  456.           should close the configuration file.
  457.  
  458.           Normally, your  program is  invoked with a command line parameter
  459.           giving the name of the configuration file to use:
  460.  
  461.                DOOR DOOR.CNF
  462.  
  463.           You would use the argv parameter to your main function to extract
  464.           the configuration  parameter and  then pass  this parameter on to
  465.           read_cnf. This  allows the end user to use a single program (your
  466.  
  467.  
  468.  
  469.                                        Page 9
  470.  
  471.  
  472.  
  473.           GAP Communications                                         GAPCDR
  474.  
  475.  
  476.           program) with  multiple configuration  files. This  is especially
  477.           important under  multi-user systems  where separate configuration
  478.           files are needed.
  479.  
  480.           The configuration  file is  opened as a stream, so using fgets or
  481.           any of  the stream  input  functions  would  be  appropriate  for
  482.           reading the  data. Remember  that the file pointer is passed back
  483.           to you  after the  call to  read_cnf. An example of the first few
  484.           "door" statements that might appear in a source file would be:
  485.  
  486.              FILE *cnf_file;                 // pointer to config file
  487.  
  488.              cnf_file = read_cnf(argv[1]);   // read the cnf file
  489.              init_door();                    // init the door
  490.              fclose(cnf_file);               // close the cnf file
  491.  
  492.  
  493.           If there  were no errors, read_cnf will return. You must now make
  494.           a call  to init_door. Init_door uses the information derived from
  495.           line 1  of the  configuration file  to open and read DOOR.SYS. In
  496.           addition, init_door  opens the  communications port  (if a remote
  497.           user is  on), initializes  some global variables, initializes the
  498.           random  number   generator,  initializes  the  ANSI  driver,  and
  499.           installs a  Ctrl-Break handler.  If there  is an error, init_door
  500.           will not return. Instead it will end the program.
  501.  
  502.           That is  basically all  you have  to do  to initialize the GAPCDR
  503.           module. When  your  program  ends,  you  should  clean  house  if
  504.           necessary and  call leave.  Leave closes  the communications port
  505.           and any  open files,  restores the ISR routines to their original
  506.           state, sends  a sign off message to the caller, and then exits to
  507.           DOS. It  is of vital importance to exit the door by making a call
  508.           to leave.  Failure to  do so  will leave communication interrupts
  509.           active and  the ctrl-break intercept active. The vectors to these
  510.           routines will  be left  in the  interrupt vector  table  and  the
  511.           computer will surely lock up the first time any program is run.
  512.  
  513.  
  514.           Points To Remember
  515.  
  516.              To get  the ball  rolling, include  GAPCDR.H  after  the  C
  517.              header files.
  518.  
  519.              To initialize the door, call read_cnf with the name of your
  520.              program's configuration file. Then call init_door.
  521.  
  522.              Call leave when your program is finished.
  523.  
  524.  
  525.  
  526.  
  527.                                        Page 10
  528.  
  529.  
  530.  
  531.           GAP Communications                                         GAPCDR
  532.  
  533.  
  534.              All input and output should be performed through the GAPCDR
  535.              functions. The sample program gives good examples on how to
  536.              accomplish this.  If you  use the C runtime output routines
  537.              such as  printf or  cputs, the  local screen will be a mess
  538.              because the  internal ANSI  driver will  not know where the
  539.              cursor is.
  540.  
  541.              To determine  if the  BBS is a single or multi user system,
  542.              check the  variable called  multi. If  it is anything other
  543.              than  0,   then  the  BBS  is  multi-user  and  you  should
  544.              read/write your data files with sharing attributes.
  545.  
  546.              Do not  use any  of the  BBS  specific  functions  such  as
  547.              read_pcbsys or  read_gapuser  unless  you  know  that  your
  548.              program is running with the appropriate BBS system. You may
  549.              want to  use a flag in your configuration file to determine
  550.              which system  your program is running with. These functions
  551.              were provided  to make  your programming choores easier but
  552.              using them  basically restricts your door to the respective
  553.              BBS system that the functions interact with.
  554.  
  555.              To test  your program,  you will  need a DOOR.SYS file that
  556.              was written  for local  exit. Of  course,  you  can  always
  557.              modify any  DOOR.SYS file and change the first line so that
  558.              it reads COM0:. A complete set of sample files are provided
  559.              for testing your program under local mode.
  560.  
  561.  
  562.           Compiling And Linking          Compiling And Linking
  563.  
  564.           GAPCDR has  already been compiled with the necessary compile time
  565.           switches for both Microsoft C and Borland C.
  566.  
  567.           To compile  your programs, use whatever switches are required for
  568.           your compiler.
  569.  
  570.             Microsoft C
  571.  
  572.             cl /c /FPa door.c
  573.             link door,,NUL.MAP,+GAPCDRx
  574.  
  575.             Borland C
  576.  
  577.             bcc -c door.c
  578.             tlink c0x+door,door.exe,NUL.MAP,+GAPCDRBx+Cx
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.                                        Page 11
  586.  
  587.  
  588.  
  589.           GAP Communications                                         GAPCDR
  590.  
  591.  
  592.           Where door  is the  name of  your program  and 'x' is 'S' for the
  593.           small model library or 'L' for the large model library.
  594.  
  595.           As was  mentioned previously,  GAPCDR was  compiled with the /FPa
  596.           option  for   Microsoft  C.  The  /FPa  option  produces  smaller
  597.           executable files.
  598.  
  599.           If you licensed the source code to GAPCDR, there are suplementary
  600.           files to aid in re-compiling and librarying the source modules.
  601.  
  602.           GAPCDR has  not been  tested with  Quick C,  although there is no
  603.           reason why it should not work with the QC environment.
  604.  
  605.           GAPCDR uses  the PASCAL  function calling  convention. If you are
  606.           unfamiliar  with  this  calling  convention  it  means  that  the
  607.           parameters to  a function  are pushed onto the stack from left to
  608.           right instead  of right  to left. In addition, the function being
  609.           called is  responsible for  removing arguments from the stack. In
  610.           the C  calling  convention,  the  function  making  the  call  is
  611.           responsible for  restoring the  stack. What  this means is if you
  612.           make 10  calls to show_mess, there will be 10 instances where the
  613.           stack must  be restored  upon return  from the  function. In  the
  614.           PASCAL convention,  there will  be only  one instance  where this
  615.           will occur  and it  will be in show_mess just prior to the actual
  616.           return. The  end result of using the PASCAL calling convention is
  617.           smaller code size.
  618.  
  619.           It should be noted that the PASCAL convention cannot be used with
  620.           functions that  take a variable number of arguments. In addition,
  621.           using  the   PASCAL  convention   absolutely  requires  that  all
  622.           functions be  prototyped. Otherwise  the compiler  will  generate
  623.           redeclaration errors  and the  linker  will  generate  unresolved
  624.           external reference errors.
  625.  
  626.  
  627.           Using A Goto          Using A Goto
  628.  
  629.           A word  about using  goto. If  you licensed  the source  code  to
  630.           GAPCDR, you  will find that we use the goto in several places. It
  631.           should be  pointed out  that speed and compactness, combined with
  632.           readability, are  our number  one concerns.  We performed several
  633.           experiments with  the goto.  We took  a very simple function that
  634.           consisted of  a while  loop and  a few statements embodied within
  635.           the loop.  We took  the same  function and  rewrote  it  using  a
  636.           counter variable  and a  goto and  removed the  while  loop.  The
  637.           assembler output  and resultant  object code  was 1/2 the size as
  638.           that of the function that used the while loop.
  639.  
  640.  
  641.  
  642.  
  643.                                        Page 12
  644.  
  645.  
  646.  
  647.           GAP Communications                                         GAPCDR
  648.  
  649.  
  650.           We are  not proposing that anyone give up the fine structure of C
  651.           and use  gotos as  a beginning  programmer in  Basic might do. In
  652.           fact, if  you are  a beginning  programmer in C, you should avoid
  653.           using gotos altogether until you become more proficient.
  654.  
  655.  
  656.           BBS System Files          BBS System Files
  657.  
  658.           Since we  are firm  believers that the BBS system files belong to
  659.           the BBS  and should  not be altered by any door program, updating
  660.           the BBS  system file  is not  automatic. If  you  wish  that  any
  661.           decrease or  increase in  the user's  time (kept  track of in the
  662.           timecredit  variable),   be  made   permanent,  you   may,  after
  663.           initializing the  door, call  the function  that opens the system
  664.           file. For  PCB, this would be PCBOARD.SYS. Keep track of any time
  665.           credits  during  the  door  programs  operation,  then  call  the
  666.           function that  updates the  BBS system  file. For  GAP, you would
  667.           need to re-write DOOR.SYS with any updated information.
  668.  
  669.  
  670.  
  671.           Sysop Setup And Functions          Sysop Setup And Functions
  672.  
  673.  
  674.           These sysop  setup and  function descriptions should be placed in
  675.           the documentation  of your  door program.  You should, of course,
  676.           change the setup information to fit your particular needs.
  677.  
  678.           Door programs  written with the GAPCDR Door Interface Module will
  679.           run on any BBS system that is capable of writing a DOOR.SYS file.
  680.           For GAP  Communications and  WildCat, you need do nothing special
  681.           when configuring your doors. These programs will write a DOOR.SYS
  682.           file automatically.  For PCBoard,  you must  explicitly tell  the
  683.           Door File  editor to  write a  DOOR.SYS file,  when setting  up a
  684.           GAPCDR door program.
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.                                        Page 13
  702.  
  703.  
  704.  
  705.           GAP Communications                                         GAPCDR
  706.  
  707.  
  708.           Configuration          Configuration
  709.  
  710.           To configure the door for a particular BBS setup, a configuration
  711.           file must  be used.  At the  very minimum, this file will contain
  712.           four lines.  It may  contain more  than  four  depending  upon  a
  713.           particular door's  configuration requirements.  The name  of  the
  714.           file is  usually the  same as that of the door program but with a
  715.           CNF extension.  The minimum  requirements for  the  file  are  as
  716.           follows:
  717.  
  718.                           c:\gap
  719.                           The Crow's Nest BBS
  720.                           IRQ
  721.                           Port Address
  722.  
  723.  
  724.           The first  line is  the full  path to your BBS default directory.
  725.           For GAP, this is usually C:\GAP. For PCB, this is usually C:\PCB.
  726.           The second  line is  the name  of your BBS. The third line is the
  727.           IRQ that  should be used for the port, and the fourth line is the
  728.           Base Port Address. If you are just using Com 1 and Com 2, you may
  729.           enter a 0 on these two lines.
  730.  
  731.           GAPCDR will obtain the sysop's name from the DOOR.SYS file.
  732.  
  733.           You must  now create  a batch file to invoke the door. This batch
  734.           file is  placed in  the directory  where you  told your BBS SetUp
  735.           program to look for it. Such a batch file might look like this:
  736.  
  737.  
  738.                           @echo off
  739.                           cd \gap\doors\tourist
  740.                           tourist tourist.cnf
  741.                           cd \gap
  742.  
  743.  
  744.           As you  can see, the door is invoked by passing the configuration
  745.           file name as  the first parameter.
  746.  
  747.           You will  also need  to modify your doors menu files and the data
  748.           file that  tells the  BBS what  your doors  are and  the security
  749.           level needed to access them. For GAP, these are respectively:
  750.  
  751.             DOORM
  752.             DOORMG
  753.             DOORS.DAT
  754.  
  755.  
  756.  
  757.  
  758.  
  759.                                        Page 14
  760.  
  761.  
  762.  
  763.           GAP Communications                                         GAPCDR
  764.  
  765.  
  766.           If you  are running  multi-nodes, simply  create a  separate door
  767.           configuration file  for each node, and number them. For instance,
  768.           for a  3 node  system, you might have the following configuration
  769.           files:
  770.  
  771.             TOURIST1.CNF
  772.             TOURIST2.CNF
  773.             TOURIST3.CNF
  774.  
  775.           The only difference between the three would be the 1st line which
  776.           points to the default directory for the particular node.
  777.  
  778.           Multi-user operation  is automatic.The  DOOR.SYS file  contains a
  779.           field that specifies if the BBS is multi-user or not.
  780.  
  781.  
  782.           Sysop Functions          Sysop Functions
  783.  
  784.           The  following  sysop  functions  are  available  while  awaiting
  785.           keyboard input :
  786.  
  787.             F5              - Shell to DOS.
  788.             F8              - Twit user and return to BBS.
  789.             F10             - Initiate chat with user.
  790.             CF10            - Answer user page bell.
  791.             Home            - Main user stats.
  792.             End             - Displays sysop keys available.
  793.             PgDn            - Secondary user stats.
  794.             Up Arrow        - Increase user's time remaining.
  795.             Dn Arrow        - Decrease user's time remaining.
  796.  
  797.  
  798.           One of  the nicer  features about using the TWIT key, is the user
  799.           is not  told that  "the sysop  wants them  to return to the BBS".
  800.           Instead, a very plain and simple message of "returning you to the
  801.           BBS" is displayed. This way, the user is given no indication that
  802.           the sysop is hovering about.
  803.  
  804.           When using  the F5  shell to  DOS key,  to  return  to  the  door
  805.           program, simply  type EXIT  at the  DOS command prompt. It is not
  806.           necessary to  change directories  back  to  the  door  directory.
  807.           GAPCDR is smart enough to know which drive and directory the door
  808.           program is  in and  will reset the defaults upon return from DOS.
  809.           In addition, the status line will remain on the screen.
  810.  
  811.           It should  be noted  that when  in a DOS shell, the GAPCDR status
  812.           line is  protected by  intercepting BIOS  video calls. If you use
  813.           ANSI.SYS replacements which write directly to the video, you will
  814.  
  815.  
  816.  
  817.                                        Page 15
  818.  
  819.  
  820.  
  821.           GAP Communications                                         GAPCDR
  822.  
  823.  
  824.           not have this protection and your status line will scroll off the
  825.           screen
  826.  
  827.           The Up  and Down Arrow keys increase and decrease the user's time
  828.           respectively by  5 minutes for each press of the key. There is no
  829.           indication of  what is  occurring (except  by the fact the user's
  830.           time remaining  will change), so the sysop should try not to have
  831.           a lead  finger. The  increase or decrease is effective only while
  832.           the user  is in the door. Whether or not these time credits (plus
  833.           or minus)  are made  a permanent  part of the user record so that
  834.           upon return  from the  DOOR, the BBS program will recognize them,
  835.           depends upon the door author.
  836.  
  837.  
  838.  
  839.           Advanced Applications          Advanced Applications
  840.  
  841.  
  842.           GAPCDR includes a great many advanced functions which can be used
  843.           with or  without the  BBS Door  Interface (i.e., automatic status
  844.           line, time left checking, keyboard timeout checking, etc).
  845.  
  846.  
  847.           Communications          Communications
  848.  
  849.           The communications  functions are  an integral part of GAPCDR and
  850.           are called  automatically by  an output  routine if  the variable
  851.           local is  set to  0. However,  they may  be used  stand alone  or
  852.           called directly  if necessary.  These routines  are  fully  self-
  853.           contained with the exception of 3 global variables and 3 external
  854.           functions.
  855.  
  856.           The global variables are:
  857.  
  858.             baud            - Port speed
  859.             gotdv           - Flag signalling the presense of DESQview
  860.             port            - Communications Port Number
  861.  
  862.  
  863.           The external functions are:
  864.  
  865.             no_carrier      - Called if carrier is dropped
  866.             timer           - Time delay routine
  867.             dv_pause        - Called to give up time slice
  868.  
  869.  
  870.           Before  using   the  communications   routines  as   stand  alone
  871.           functions, you  should make  a call to dv_here so that it can set
  872.  
  873.  
  874.  
  875.                                        Page 16
  876.  
  877.  
  878.  
  879.           GAP Communications                                         GAPCDR
  880.  
  881.  
  882.           the gotdv  flag. If  you are  not concerned about the presense of
  883.           DESQview, you must declare this variable and initialize it to 0:
  884.  
  885.             short near gotdv = 0;
  886.  
  887.           Note that it must be declared such that it resides in the default
  888.           data segment.  If you  declare the  variable yourself,  you  must
  889.           insure that  the DESQVIEW.ASM  module is  not linked  in to  your
  890.           program. You will need to create a dummy function called dv_pause
  891.           that does  nothing but  return. This is necessary because even if
  892.           you do  not wish  to use  the dv_pause  function, the linker will
  893.           complain if it cannot find it:
  894.  
  895.             void _pascal dv_pause(void);
  896.  
  897.           Next, you  must set the variable port to the port number you will
  898.           be using.  Ports start  at 0, where COM 1 equals Port 0. Then set
  899.           the variable baud to the bps rate you want the port opened at.
  900.  
  901.           Your program  will need  to include a function called no_carrier.
  902.           It is prototyped as:
  903.  
  904.             void _pascal no_carrier(void);
  905.  
  906.           This function  is called by the communications routines when they
  907.           detect that  there is  no carrier.  You may  do whatever you wish
  908.           inside this function but keep in mind that it will continue to be
  909.           called if  there is no carrier on the port. You most certainly do
  910.           not want  to make  calls to  any of  the communications functions
  911.           from inside  this routine  or a  stack overflow  will  eventually
  912.           result. If  you wish  to do  your own  carrier detecting  (as you
  913.           would if  you were  going to be using these functions to create a
  914.           dial out  type of program), then this function can simply contain
  915.           a return.
  916.  
  917.           Once you  have the global variables configured, the first step in
  918.           initializing the  serial port  is to  make  a  call  to  setport.
  919.           Setport creates  the receive  buffer and  then sets up the serial
  920.           port.  After  the  port  is  configured,  you  should  then  call
  921.           init_port to  set the  baud, parity,  and  data  bits.  Init_port
  922.           supports all  the baud  rates that  a UART  on  an  IBM  type  of
  923.           computer is  capable of  utilizing. After  this the port is fully
  924.           configured and may now be utilized. Before your program ends, you
  925.           must call reset_port to restore the interrupt vector back the way
  926.           it was.
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.                                        Page 17
  934.  
  935.  
  936.  
  937.           GAP Communications                                         GAPCDR
  938.  
  939.  
  940.           The main input routines are:
  941.  
  942.             comgetc         - Get a single character from the port
  943.             comgetd         - Get a character with timeout
  944.  
  945.  
  946.           The main output routines are:
  947.  
  948.             computc         - Send a single character
  949.             computs         - Send a string
  950.  
  951.  
  952.           There are  routines for checking carrier, turning DTR on and off,
  953.           checking if  there are  any characters in the receive buffer, and
  954.           clearing the receive buffer.
  955.  
  956.           If you  need to change baud rates simple set the variable baud to
  957.           whatever bps rate you want to change to and then call init_port.
  958.  
  959.  
  960.           DOS Window          DOS Window
  961.  
  962.           GAPCDR includes  some very advanced functions for setting up what
  963.           we call  a DOS  Window. This  is a  Window that you define on the
  964.           local screen  and to which all DOS output will be redirected. For
  965.           instance, if  you needed  to shell  to DOS to run PKUNZIP or DSZ,
  966.           you could  set up  a DOS  Window and  all output  from these  two
  967.           programs will be contained inside the window. The window can also
  968.           be used  without shelling  to DOS  although there  is  really  no
  969.           practical use for doing so.
  970.  
  971.           To set  up a  DOS window, the first thing you should do is make a
  972.           call to  get_attr so that the current screen colors can be stored
  973.           away. This  is necessary  because you  may want  to  use  special
  974.           colors in  your  DOS  window.  By  storing  the  original  screen
  975.           attributes, they  can be  restored when  you  close  the  window,
  976.           thereby keeping  the user's  screen colors the way the user likes
  977.           them!
  978.  
  979.           At the  beginning of  your program  call get_attr. Do this before
  980.           you do any screen output. You will then make several calls to the
  981.           various GAPCDR  functions to  setup your  DOS window.  Once it is
  982.           configured, you  can then  shell to DOS and do whatever you like.
  983.           All screen  output will take place inside the window. Please note
  984.           that if  you use a console driver other than CON or ANSI.SYS (and
  985.           this generally  includes all  so called video speed up programs),
  986.           or run  a program that writes directly to the screen, then output
  987.           will not  take place  inside of the window. This is because video
  988.  
  989.  
  990.  
  991.                                        Page 18
  992.  
  993.  
  994.  
  995.           GAP Communications                                         GAPCDR
  996.  
  997.  
  998.           speed up  programs generally write directly to the screen instead
  999.           of using the BIOS.
  1000.  
  1001.           To see  how the  DOS window works, after setting it up, issue the
  1002.           following call:
  1003.  
  1004.             system("COMMAND");
  1005.  
  1006.           This will  put you  in a  DOS shell. You may then execute various
  1007.           DOS functions  and get  a feel for what it looks like. Be sure to
  1008.           type "exit" to return to your program.
  1009.  
  1010.           When you no longer need the DOS window, it is imperitive that you
  1011.           remove the  interrupt 10 (BIOS) intercepter or your computer will
  1012.           hang when you exit the program.
  1013.  
  1014.           There is  a fully  working example  of a  DOS Window in the CDOOR
  1015.           example program.  It shows  how to  save a portion of the screen,
  1016.           draw a box, set up the interrupt 10 intercepter and shell to DOS.
  1017.           Upon return from the shell, it will remove the DOS Window.
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.                                        Page 19
  1050.  
  1051.  
  1052.  
  1053.           GAP Communications                                         GAPCDR
  1054.  
  1055.  
  1056.           Variables          Variables
  1057.  
  1058.  
  1059.  
  1060.           Defines          Defines
  1061.  
  1062.           The following defines are used when calling show_mess.
  1063.  
  1064.             NO           - Defined as 0
  1065.             YES          - Defined as 1
  1066.  
  1067.           Ansi Variables          Ansi Variables
  1068.  
  1069.           ANSI strings contain the actual ANSI color sequences.
  1070.  
  1071.             A_BLACK      - ANSI codes for Black
  1072.             A_BLUE       - ANSI codes for Blue
  1073.             A_BROWN      - ANSI codes for Brown
  1074.             A_CYAN       - ANSI codes for Cyan
  1075.             A_GREEN      - ANSI codes for Green
  1076.             A_MAGENTA    - ANSI codes for Magenta
  1077.             A_RED        - ANSI codes for Red
  1078.             A_WHITE      - ANSI codes for White
  1079.  
  1080.  
  1081.             A_BBLACK     - ANSI codes for Grey
  1082.             A_BBLUE      - ANSI codes for bright Blue
  1083.             A_BCYAN      - ANSI codes for bright Cyan
  1084.             A_BGREEN     - ANSI codes for bright Green
  1085.             A_BMAGENTA   - ANSI codes for bright Magenta
  1086.             A_BRED       - ANSI codes for bright Red
  1087.             A_BWHITE     - ANSI codes for bright White
  1088.             A_YELLOW     - ANSI codes for Yellow
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.                                        Page 20
  1108.  
  1109.  
  1110.  
  1111.           GAP Communications                                         GAPCDR
  1112.  
  1113.  
  1114.           DOOR.SYS Variables          DOOR.SYS Variables
  1115.  
  1116.           DOOR.SYS variables  are initialized  while reading  the  DOOR.SYS
  1117.           file. These variables are the door programmer's connection to the
  1118.           BBS.
  1119.  
  1120.  
  1121.           Short Integers          Short Integers
  1122.  
  1123.             alarm        - 0 = caller alarm off, 1 = on
  1124.             baud         - DTE bps rate (unsigned)
  1125.             bell         - 0 = page bell off, 1 = bell on
  1126.             color        - 0 = no color, 1 = color
  1127.             curfiles     - current files downloaded
  1128.             dflt_color   - BBS default color
  1129.             expert       - 0 = novice, 1 = expert
  1130.             level        - user's security level
  1131.             local        - 0 = remote user, 1 = local user
  1132.             maxfiles     - max files available
  1133.             minsleft     - minutes left at door start
  1134.             multi        - 1 = system is multi-user
  1135.             node         - node number in use, 0 = single
  1136.             page         - page length
  1137.             parity       - actually data bits, not used
  1138.             port         - com port being used
  1139.             printer      - 0 = printer off, 1 = printer on
  1140.             realcredit   - time credits from the BBS
  1141.             screen       - 0 = screen off, 1 = screen on
  1142.             userbaud     - remote user's bps rate (unsigned)
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.                                        Page 21
  1166.  
  1167.  
  1168.  
  1169.           GAP Communications                                         GAPCDR
  1170.  
  1171.  
  1172.           Long Integers          Long Integers
  1173.  
  1174.             curbytes     - current download bytes
  1175.             doors_open   - total doors opened
  1176.             downbytes    - total download bytes
  1177.             downloads    - total number of downloads
  1178.             maxbytes     - max bytes can download
  1179.             mesleft      - total messages left
  1180.             recnum       - user's record number
  1181.             timeson      - # of times on
  1182.             upbytes      - total upload bytes
  1183.             uploads      - total number of uploads
  1184.  
  1185.           Character Arrays          Character Arrays
  1186.  
  1187.             bphone       - user's business phone number
  1188.             city         - user's home town
  1189.             event_time   - event run time
  1190.             fname        - user's first name
  1191.             handle       - caller's Handle
  1192.             hphone       - user's home phone number
  1193.             last_new     - last new files scan
  1194.             lastdate     - last date user was on
  1195.             lname        - user's last name
  1196.             password     - user's password
  1197.             subscrip     - date user's subscription expires
  1198.             username     - user's full name
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.                                        Page 22
  1224.  
  1225.  
  1226.  
  1227.           GAP Communications                                         GAPCDR
  1228.  
  1229.  
  1230.           Global Variables          Global Variables
  1231.  
  1232.           These variables are the documented, global variables (initialized
  1233.           and used  by GAPCDR).  They may  be modified  and/or used  at the
  1234.           programmer's discretion.
  1235.  
  1236.  
  1237.           Characters          Characters
  1238.  
  1239.             chat         - true if chatting with user
  1240.             clockon      - 0 no clock, 1 display clock
  1241.             column       - column we are at now
  1242.             endview      - true if dont want to viewany more
  1243.             flag         - flag that a space was pressed
  1244.             instatus     - if doing status line
  1245.             noup         - if 1, dont uppercase characters
  1246.             NS           - true if in Non Stop mode
  1247.             redisplay    - true if wants to start over
  1248.             usemore1     - true if showing a file
  1249.             view         - true to use the more prompt
  1250.             wordwrap     - column to wrap words at
  1251.  
  1252.           Short Integers          Short Integers
  1253.  
  1254.             base_add     - base address for port
  1255.             irq          - IRQ for port
  1256.             lines        - # of lines currently displayed
  1257.             normal       - current display color
  1258.             timecredit   - any time credits user may have
  1259.             timeleft     - time user has left
  1260.  
  1261.           Long Integers          Long Integers
  1262.  
  1263.             starttime    - time door opened
  1264.             temptime     - for calculating time out
  1265.             timenow      - current time
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.                                        Page 23
  1282.  
  1283.  
  1284.  
  1285.           GAP Communications                                         GAPCDR
  1286.  
  1287.  
  1288.           Character Arrays          Character Arrays
  1289.  
  1290.             anystring    - global garbage collector
  1291.             bbs_dir      - path to DOOR.SYS
  1292.             birthday     - caller's birth date
  1293.             board_name   - name of the BBS
  1294.             BS           - backspace characters
  1295.             CRLF         - carriage return/line feed characters
  1296.             curtime      - holds the current time as a string
  1297.             gendir       - path to the BBS gen dir
  1298.             maindir      - path to the BBS main dir
  1299.             strtime      - holds the time string
  1300.             sysname      - sysop's name
  1301.  
  1302.           Structures          Structures
  1303.  
  1304.             GAP_USER user     - GAP's User Record
  1305.             PCBSYS pcbsys     - PCB's System Record
  1306.             PCBUSER pcbuser   - PCB's User Record
  1307.  
  1308.  
  1309.           These structures are fully commented in the GAPCDR.H header file.
  1310.           Note that  when utilizing  the GAP  user  structure,  all  string
  1311.           fields are fully padded with spaces and the last position must be
  1312.           a 0.
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.                                        Page 24
  1340.  
  1341.  
  1342.  
  1343.           GAP Communications                                         GAPCDR
  1344.  
  1345.  
  1346.           Functions - Quick Reference          Functions - Quick Reference
  1347.  
  1348.  
  1349.             access1         - Checks for the existence of a file.
  1350.             ansi            - Displays ANSI color strings.
  1351.             backspace       - Sends one or more backspaces.
  1352.             ckeypress       - Checks for a remote or local key press.
  1353.             clear_scrn      - Clears the local and remote screens.
  1354.             clr_buf         - Cleare the communications receive buffer.
  1355.             cls             - Clears the 1st 23 lines on the local screen.
  1356.             cls_all         - Clears the entire local screen.
  1357.             comgetc         - Gets a character from com port.
  1358.             comgetd         - Geta a character from com port with timeout.
  1359.             computb         - Sends a buffer of data to com port.
  1360.             computc         - Sends a character to com port.
  1361.             computs         - Sends a string to com port.
  1362.             cursoff         - Turns local cursor off.
  1363.             curson          - Turns local cursor on.
  1364.             do_chat         - To allow sysop to chat with remote user.
  1365.             dtr             - Toggels the DTR line on or off.
  1366.             dv_here         - Checks for the presense of DESQView.
  1367.             dv_pause        - Gives up remainder of time slice to DV.
  1368.             elap_time       - Computes elapsed time.
  1369.             empty           - Empties a string.
  1370.             fix_color       - Modifies ANSI driver for color or mono.
  1371.             gapputc         - Sends a character to local and remote.
  1372.             gapputs         - Sends a string to local and remote screens.
  1373.             getakey         - Gets one key responses.
  1374.             getkeyc         - Gets keyboard character and scan code.
  1375.             get_attr        - Gets startup video attribute.
  1376.             get_random      - Returns a random number.
  1377.             get_string      - Gets a string of characters.
  1378.             init_ansi       - Initializes ANSI driver.
  1379.             init_com        - Initializes Communications Port.
  1380.             init_door       - Initializes the Door.
  1381.             init_port       - Sets up Communications Port.
  1382.             iscd            - Checks if there is a Carrier.
  1383.             leave           - Shuts down door and returns to the BBS.
  1384.             lputc           - Sends a character to local screen.
  1385.             lputs           - Sends a string to local screen.
  1386.             make_sound      - Makes noise on local computer.
  1387.             more            - Checks for a full screen.
  1388.             nl              - Sends a CR/LF to local and remote.
  1389.             no_carrier      - Called by the Comm Routines if Carrier lost.
  1390.             pagesysop       - Alerts sysop that the user wants to chat.
  1391.             pause           - Sends a "Press [Any Key] To Continue" prompt.
  1392.             putkey          - Used by chat for word wrapping.
  1393.             read_cnf        - Reads the door configuration file.
  1394.  
  1395.  
  1396.  
  1397.                                        Page 25
  1398.  
  1399.  
  1400.  
  1401.           GAP Communications                                         GAPCDR
  1402.  
  1403.  
  1404.             read_doorsys    - Reads DOOR.SYS.
  1405.             read_gapuser    - Reads USERS.DAT.
  1406.             read_pcbsys     - Reads PCBOARD.SYS.
  1407.             read_pcbuser    - Reads PCB USERS file.
  1408.             read_score      - Reads and displays top 10 scores.
  1409.             reset_port      - Restores Communications Port.
  1410.             restore_screen  - Restores a portion of the screen.
  1411.             rest_cbreak     - Restores Ctrl-Break vector.
  1412.             rest_int10      - Restores BIOS vector.
  1413.             rts             - Toggels RTS line on or off.
  1414.             rxempty         - Checks if any characters in receive buffer.
  1415.             save_screen     - Saves a portion of the screen.
  1416.             setport         - Initializes Communications port.
  1417.             set_attr        - Sets video attributes.
  1418.             set_cbreak      - Initializes Ctrl-Break vector.
  1419.             set_cord        - Sets up a DOS Window.
  1420.             set_int10       - Initializes BIOS trapper.
  1421.             set_status      - Displays status line.
  1422.             show_file       - Displays text files.
  1423.             show_mess       - Displays a message.
  1424.             timer           - Time Delay.
  1425.             time_credit     - Gives credits for time used.
  1426.             time_left       - Computes time remaining.
  1427.             trim            - Trims spaces from string.
  1428.             update_clock    - Updates status line clock.
  1429.             wrap_word       - Wraps a word.
  1430.             write_gapuser   - Writes USERS.DAT.
  1431.             write_pcbsys    - Writes PCBOARD.SYS.
  1432.             write_pcbuser   - Writes PCB USERS.
  1433.             write_score     - Creates and maintains top 10 scores file.
  1434.  
  1435.  
  1436.           Functions - Detailed Reference          Functions - Detailed Reference
  1437.  
  1438.  
  1439.           Functions will  return either a void (nothing), a short value, or
  1440.           a character pointer.
  1441.  
  1442.           The function  descriptions will note whether or not a function is
  1443.           high level  or low  level. The high level functions are basically
  1444.           the only  functions you  will ever  need to  use. When necessary,
  1445.           they will  call other  functions to carry out their work. The low
  1446.           level functions,  on the other hand, are more single purpose, and
  1447.           they generally  require calls  to other  low level  functions  to
  1448.           perform the same task as one call to a high level function.
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.                                        Page 26
  1456.  
  1457.  
  1458.  
  1459.           GAP Communications                                         GAPCDR
  1460.  
  1461.  
  1462.           access1
  1463.           -----------------------------------------------------------------
  1464.  
  1465.           Purpose       Checks for the existence of a file.
  1466.  
  1467.                         short access1(char *filename);
  1468.  
  1469.                         filename   Full path and name of file
  1470.  
  1471.           Type          High Level
  1472.  
  1473.           Description   This function is used to check for the existence of
  1474.                         a file. It works in a multi-user environment and is
  1475.                         not affected by file sharing attributes.
  1476.  
  1477.           Return Value  0 = File exists, 1 = File not found.
  1478.  
  1479.           Example
  1480.  
  1481.              if ((access1("FILE.DAT")))
  1482.                show_mess("Sorry, File does not Exist!", YES,YES);
  1483.  
  1484.  
  1485.           ansi
  1486.           -----------------------------------------------------------------
  1487.  
  1488.           Purpose       Displays ANSI color sequences.
  1489.  
  1490.                         void ansi(char *color);
  1491.  
  1492.                         color      Ansi color string
  1493.  
  1494.           Type          High Level
  1495.  
  1496.           Description   This function  will send  a string  of ANSI  escape
  1497.                         sequences to  the remote  user  and  to  the  local
  1498.                         console. The  ANSI codes for the various colors are
  1499.                         declared as  global variables.  If  the  remote  or
  1500.                         local user  is in  non graphics  mode, the function
  1501.                         returns immediately.
  1502.  
  1503.           Return Value  None.
  1504.  
  1505.           Example       ansi(A_BWHITE); // Change color to bright white
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.                                        Page 27
  1514.  
  1515.  
  1516.  
  1517.           GAP Communications                                         GAPCDR
  1518.  
  1519.  
  1520.           backspace
  1521.           -----------------------------------------------------------------
  1522.  
  1523.           Purpose       Sends one or more backspaces.
  1524.  
  1525.                         void backspace(short num);
  1526.  
  1527.                         num        Number of backspaces to send
  1528.  
  1529.           Type          High Level
  1530.  
  1531.           Description   In order  to actually  erase  a  character  on  the
  1532.                         screen, you  must send a 3 character sequence which
  1533.                         consists  of   backspace,  space,  backspace.  This
  1534.                         function will  send as  many of  these 3  character
  1535.                         sequences as you specify in the parameter list.
  1536.  
  1537.           Return Value  None.
  1538.  
  1539.           Example       backspace(1);     // erase last character sent
  1540.  
  1541.  
  1542.  
  1543.           ckeypress
  1544.           -----------------------------------------------------------------
  1545.  
  1546.           Purpose       Checks for a remote or local key press.
  1547.  
  1548.                         short ckeypress(void);
  1549.  
  1550.           Type          High Level
  1551.  
  1552.           Description   This function will check the local keyboard as well
  1553.                         as the  communications receive  buffer to  see if a
  1554.                         key is waiting to be read. It is most often used in
  1555.                         loops   that   monitor   keyboard   timeout,   time
  1556.                         remaining, etc.
  1557.  
  1558.           Return Value  0 = no key is waiting, 1 = a key is waiting.
  1559.  
  1560.           Example       c = ckeypress();  // key pressed?
  1561.  
  1562.              while(!ckeypress())          // do nothing
  1563.                {                          // until a key is pressed
  1564.                dv_pause()                 // give up time slice
  1565.                }
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.                                        Page 28
  1572.  
  1573.  
  1574.  
  1575.           GAP Communications                                         GAPCDR
  1576.  
  1577.  
  1578.           clear_scrn
  1579.           -----------------------------------------------------------------
  1580.  
  1581.           Purpose       Clears local and remote screens.
  1582.  
  1583.                         void clear_scrn(void);
  1584.  
  1585.           Type          High Level
  1586.  
  1587.           Description   This routine  will use the assembler routine cls to
  1588.                         clear the  first 23  lines of  the local screen. If
  1589.                         the remote  caller is in non-color mode, it sends a
  1590.                         CTRL-L to the remote screen, otherwise it sends the
  1591.                         ANSI clear screen sequence.
  1592.  
  1593.           Return Value  None.
  1594.  
  1595.           Example       clear_scrn();     // clear screen
  1596.  
  1597.  
  1598.  
  1599.           clr_buf
  1600.           -----------------------------------------------------------------
  1601.  
  1602.           Purpose       Clears the Communications receive buffer.
  1603.  
  1604.                         void clr_buf(void);
  1605.  
  1606.           Type          Low Level
  1607.  
  1608.           Description   Empties the  receive buffer  such that  any pending
  1609.                         characters are simply ignored.
  1610.  
  1611.           Return Value  None.
  1612.  
  1613.           Example       clr_buf();      // clear the receive buffer
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.                                        Page 29
  1630.  
  1631.  
  1632.  
  1633.           GAP Communications                                         GAPCDR
  1634.  
  1635.  
  1636.           cls
  1637.           -----------------------------------------------------------------
  1638.  
  1639.           Purpose       Clears the first 23 lines on the local screen.
  1640.  
  1641.                         void cls(void);
  1642.  
  1643.           Type          Low Level
  1644.  
  1645.           Description   This function  will clear the first 23 lines on the
  1646.                         local  screen,  thereby  protecting  the  bottom  2
  1647.                         lines.
  1648.  
  1649.           Return Value  None.
  1650.  
  1651.           Example       cls();          // clear 1st 23 lines
  1652.  
  1653.  
  1654.  
  1655.           cls_all
  1656.           -----------------------------------------------------------------
  1657.  
  1658.           Purpose       Clears the entire local screen.
  1659.  
  1660.                         void cls_all(void);
  1661.  
  1662.           Type          Low Level
  1663.  
  1664.           Description   This function  will clear  the entire local screen.
  1665.                         It is used by leave to tidy up the screen.
  1666.  
  1667.           Return Value  None.
  1668.  
  1669.           Example       cls_all();      // clear entire screen
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.                                        Page 30
  1688.  
  1689.  
  1690.  
  1691.           GAP Communications                                         GAPCDR
  1692.  
  1693.  
  1694.           comgetc
  1695.           -----------------------------------------------------------------
  1696.  
  1697.           Purpose       Retrieve a character from communications buffer.
  1698.  
  1699.                         short comgetc(void);
  1700.  
  1701.           Type          Low Level
  1702.  
  1703.           Description   Checks  the   communications  receive   buffer  and
  1704.                         returns the next character, if any.
  1705.  
  1706.           Return Value  Next character in buffer or -1 for no characters to
  1707.                         read.
  1708.  
  1709.           Example       c = comgetc();    // get a character from remote
  1710.  
  1711.  
  1712.  
  1713.           comgetd
  1714.           -----------------------------------------------------------------
  1715.  
  1716.           Purpose       Retrieve a  character  from  comminications  buffer
  1717.                         with delay.
  1718.  
  1719.                         short comgetd(short secs);
  1720.  
  1721.                         secs       Number of seconds to wait
  1722.  
  1723.           Type          Low level
  1724.  
  1725.           Description   This function  is the  same as comgetc, except that
  1726.                         if there  are no  characters in the receive buffer,
  1727.                         it will wait for the number of seconds you specify.
  1728.                         Comgetd is  fully DESQview  aware and  will give up
  1729.                         the program's time slice while waiting for incoming
  1730.                         characters.
  1731.  
  1732.           Return Value  Next character  in buffer  or -10  for time-out (no
  1733.                         characters to read).
  1734.  
  1735.           Example
  1736.  
  1737.              if ( (comgetd(2)) == -10)    // wait for 2 seconds
  1738.                ;                          // nothing happening
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.                                        Page 31
  1746.  
  1747.  
  1748.  
  1749.           GAP Communications                                         GAPCDR
  1750.  
  1751.  
  1752.           computb
  1753.           -----------------------------------------------------------------
  1754.  
  1755.           Purpose       Sends a buffer of data out the communications port.
  1756.  
  1757.                         void computb(char *buffer,short len);
  1758.  
  1759.                         buffer     Buffer containing data to send
  1760.                         len        Number of bytes to send
  1761.  
  1762.           Type          Low Level
  1763.  
  1764.           Descripton    This function  will send  a user  suplied buffer of
  1765.                         len bytes  out the communications port, one byte at
  1766.                         a time.  It will  not return  until all  characters
  1767.                         have been sent.
  1768.  
  1769.           Return Value  None.
  1770.  
  1771.           Example       computb(buffer,100); // Send 100 bytes of data
  1772.  
  1773.  
  1774.  
  1775.           computc
  1776.           -----------------------------------------------------------------
  1777.  
  1778.           Purpose       Sends a  single character  out  the  communications
  1779.                         port.
  1780.  
  1781.                         void computc(unsigned char ch);
  1782.  
  1783.                         ch         Character to send
  1784.  
  1785.           Type          Low Level
  1786.  
  1787.           Description   Will send a single character out the communications
  1788.                         port.
  1789.  
  1790.           Return Value  None.
  1791.  
  1792.           Example       computc('A');     // Send a character
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.                                        Page 32
  1804.  
  1805.  
  1806.  
  1807.           GAP Communications                                         GAPCDR
  1808.  
  1809.  
  1810.           computs
  1811.           -----------------------------------------------------------------
  1812.  
  1813.           Purpose       Sends a string of characters out the communications
  1814.                         port.
  1815.  
  1816.                         void computs(char *str);
  1817.  
  1818.                         str        String to send
  1819.  
  1820.           Type          Low Level
  1821.  
  1822.           Description   Will  send   a  string   of  characters   out   the
  1823.                         communications port.  Note that unlike computb, the
  1824.                         number of bytes to send is determined by the length
  1825.                         of  the   string.  Therefore  this  function  stops
  1826.                         sending characters  when  it  encounters  the  null
  1827.                         byte.
  1828.  
  1829.           Return Value  None.
  1830.  
  1831.           Example       computs("Send this string");   // send a string
  1832.  
  1833.  
  1834.  
  1835.           cursoff
  1836.           -----------------------------------------------------------------
  1837.  
  1838.           Purpose       Turns the local cursor off.
  1839.  
  1840.                         void cursoff(void);
  1841.  
  1842.           Type          Low Level
  1843.  
  1844.           Description   This function  is used  to turn  the cursor  on the
  1845.                         local monitor off.
  1846.  
  1847.           Return Value  None.
  1848.  
  1849.           Example       cursoff();      // turn the cursor off
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.                                        Page 33
  1862.  
  1863.  
  1864.  
  1865.           GAP Communications                                         GAPCDR
  1866.  
  1867.  
  1868.           curson
  1869.           -----------------------------------------------------------------
  1870.  
  1871.           Purpose       Turns the local cursor on.
  1872.  
  1873.                         void curson(void);
  1874.  
  1875.           Type          Low Level
  1876.  
  1877.           Description   This function  is used  to turn  the cursor  on the
  1878.                         local monitor on.
  1879.  
  1880.           Return Value  None.
  1881.  
  1882.           Example       curson();       // turn the cursor on
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.                                        Page 34
  1920.  
  1921.  
  1922.  
  1923.           GAP Communications                                         GAPCDR
  1924.  
  1925.  
  1926.           do_chat
  1927.           -----------------------------------------------------------------
  1928.  
  1929.           Purpose       To allow sysop to chat with remote user.
  1930.  
  1931.                         void do_chat(void);
  1932.  
  1933.           Type          High Level
  1934.  
  1935.           Description   This function  allows a  one on one chat with a re-
  1936.                         mote user.  If the  caller is in graphics mode, the
  1937.                         sysop's key  presses will be displayed in green and
  1938.                         the remote  user's key presses will be displayed in
  1939.                         white. Text  will automatically  wrap at column 76.
  1940.                         To exit  chat, press  either the  ESC key or type a
  1941.                         CTRL-X. Note  that the  user may  also  send  these
  1942.                         characters to  end chat. The user will receive full
  1943.                         credit for  the time spent chatting with the sysop.
  1944.                         However, this  function will  not  update  the  BBS
  1945.                         system file  so it is possible that the user may be
  1946.                         logged off  (with an  out  of  time  message)  when
  1947.                         he/she returns to the BBS.
  1948.  
  1949.           Return Value  None.
  1950.  
  1951.           Example       do_chat();        // chat with caller
  1952.  
  1953.              empty(response,1);           // initialize string
  1954.  
  1955.              get_string(response);        // get a string
  1956.  
  1957.              if (response[0] == 'P')      // paging sysop
  1958.                do_chat();                 // chat with sysop
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.                                        Page 35
  1978.  
  1979.  
  1980.  
  1981.           GAP Communications                                         GAPCDR
  1982.  
  1983.  
  1984.           dtr
  1985.           -----------------------------------------------------------------
  1986.  
  1987.           Purpose       Toggle the DTR line on and off.
  1988.  
  1989.                         void dtr(short how)
  1990.  
  1991.                         how        0 = Turn DTR off.
  1992.                                    1 = Turn DTR on
  1993.  
  1994.           Type          Low Level
  1995.  
  1996.           Description   This routine  is used  to turn  the DTR line of the
  1997.                         communications port  on or  off.  Turning  DTR  off
  1998.                         while there  is a  carrier will  cause the modem to
  1999.                         drop carrier on the remote caller. In order to send
  2000.                         commands to the modem, DTR needs to be on.
  2001.  
  2002.           Return Value  None.
  2003.  
  2004.           Example
  2005.  
  2006.              dtr(1);                         // turn DTR on
  2007.              computs("ATZ");                 // reset the modem
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.                                        Page 36
  2036.  
  2037.  
  2038.  
  2039.           GAP Communications                                         GAPCDR
  2040.  
  2041.  
  2042.           dv_here
  2043.           -----------------------------------------------------------------
  2044.  
  2045.           Purpose       Checks to  see if  the  program  is  running  under
  2046.                         DESQview.
  2047.  
  2048.                         short dv_here(void);
  2049.  
  2050.           Type          Low Level
  2051.  
  2052.           Description   This function  should generally  be called  when  a
  2053.                         program first  starts (before  any screen output is
  2054.                         performed). It  makes a  special DOS call to see if
  2055.                         DESQview is  installed. If  so, it sets an internal
  2056.                         flag indicating  the presense of DV. If the program
  2057.                         is detected  to be  running under DESQview then all
  2058.                         "do nothing"  loops (those  loops that  are looking
  2059.                         for something  to do  but because  they are waiting
  2060.                         for keyboard  or com input, are basically taking up
  2061.                         computer time  doing nothing),  will  give  up  the
  2062.                         remainder of their time slice after they figure out
  2063.                         there is  nothing for  them  to  do.  In  addition,
  2064.                         because the built in ANSI driver writes directly to
  2065.                         the screen, if DESQview is present, the driver will
  2066.                         instead write  to DV's  video shadow  buffer.  This
  2067.                         function is automatically called by init_door so it
  2068.                         is not necessary to call it again.
  2069.  
  2070.           Return Value  DESQview version number or 0 for not installed.
  2071.  
  2072.           Example
  2073.  
  2074.              if ( (dv_here()))
  2075.                show_mess("We are running under DESQview!", NO,YES);
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.                                        Page 37
  2094.  
  2095.  
  2096.  
  2097.           GAP Communications                                         GAPCDR
  2098.  
  2099.  
  2100.           dv_pause
  2101.           -----------------------------------------------------------------
  2102.  
  2103.           Purpose       Give up remainder of time slice to DESQview.
  2104.  
  2105.                         void dv_pause(void);
  2106.  
  2107.           Type          Low Level
  2108.  
  2109.           Description   If DESQview is installed, this function will make a
  2110.                         call to  DV such that DV will immediately switch to
  2111.                         another task.  Note that  dv_here must be called at
  2112.                         the beginning  of the  program  since  it  sets  an
  2113.                         internal variable  that this function checks to see
  2114.                         if DESQview is running.
  2115.  
  2116.                         You should  use this  function inside  of  all  "do
  2117.                         nothing" loops.
  2118.  
  2119.           Return Value  None.
  2120.  
  2121.           Example
  2122.  
  2123.              time (&temptime);            // start timer
  2124.  
  2125.              while (!getakey())           // until a key is pressed
  2126.                {
  2127.                elap_time();               // check time remaining
  2128.                dv_pause();                // give up time slice
  2129.                }
  2130.  
  2131.  
  2132.  
  2133.  
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.                                        Page 38
  2152.  
  2153.  
  2154.  
  2155.           GAP Communications                                         GAPCDR
  2156.  
  2157.  
  2158.           elap_time
  2159.           -----------------------------------------------------------------
  2160.  
  2161.           Purpose       Computes elapsed  time while  waiting for  keyboard
  2162.                         input.
  2163.  
  2164.                         void elap_time(void);
  2165.  
  2166.           Type          High Level
  2167.  
  2168.           Description   This function  is used  in loops  that await a key-
  2169.                         board response.  Prior to  entering the  loop,  the
  2170.                         variable called temptime should be initialized with
  2171.                         the  current  time.  Once  inside  the  loop,  this
  2172.                         function should  be called  to keep  track  of  the
  2173.                         elapsed time.  If there  is  no  keyboard  response
  2174.                         within 4 minutes, the user will be logged off.
  2175.  
  2176.           Return Value  None.
  2177.  
  2178.           Example
  2179.  
  2180.              time (&temptime);            // start timer
  2181.  
  2182.              while (!getakey())           // until a key is pressed
  2183.                {
  2184.                elap_time();               // check time remaining
  2185.                dv_pause();                // give up time slice
  2186.                }
  2187.  
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.  
  2195.  
  2196.  
  2197.  
  2198.  
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.                                        Page 39
  2210.  
  2211.  
  2212.  
  2213.           GAP Communications                                         GAPCDR
  2214.  
  2215.  
  2216.           empty
  2217.           -----------------------------------------------------------------
  2218.  
  2219.           Purpose       Empties a string to all spaces.
  2220.  
  2221.                         void empty(char *str,short len);
  2222.  
  2223.                         str        The string to be emptied
  2224.                         len        Number of bytes to clear
  2225.  
  2226.           Type          High Level
  2227.  
  2228.           Description   Before using  the string input routine, get_string,
  2229.                         the string  must first  be cleared  to the  maximum
  2230.                         number of  bytes allowed  to be input. Empty clears
  2231.                         the string  to all  spaces and  adds a null byte at
  2232.                         the end.  The null  byte is  not counted in the len
  2233.                         parameter.
  2234.  
  2235.           Return Value  None.
  2236.  
  2237.           Example
  2238.  
  2239.              char instr [11];
  2240.  
  2241.              empty(instr,10);             // empty the string
  2242.              get_string(instr);           // get up to 10 characters
  2243.                                           // of input
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262.  
  2263.  
  2264.  
  2265.  
  2266.  
  2267.                                        Page 40
  2268.  
  2269.  
  2270.  
  2271.           GAP Communications                                         GAPCDR
  2272.  
  2273.  
  2274.           fix_color
  2275.           -----------------------------------------------------------------
  2276.  
  2277.           Purpose       Modify ANSI driver according to user's color.
  2278.  
  2279.                         void fix_color(void);
  2280.  
  2281.           Type          Low Level
  2282.  
  2283.           Description   The ANSI  driver is  self modifying,  meaning  that
  2284.                         depending upon the color preference of the user, it
  2285.                         will adjusts its code accordingly. This function is
  2286.                         called by  init_ansi and  should never  need to  be
  2287.                         called  by   the  programmer  directly  unless  the
  2288.                         programmer provides  a menu choice whereby a caller
  2289.                         may toggle his/her color mode on and off. In such a
  2290.                         case, you  would immediately need to call fix_color
  2291.                         so that  the ANSI  driver can  adjusts itself.  The
  2292.                         caller's color preference is stored in the variable
  2293.                         color where 0 means no color, and 1 means color.
  2294.  
  2295.           Return Value  None.
  2296.  
  2297.           Example
  2298.  
  2299.              show_mess("Toggle Color",NO,NO);     // part of menu
  2300.  
  2301.              empty(response,1);           // clear string
  2302.              get_string(response);        // get response to menu
  2303.  
  2304.              if (response[0] == 'C')      // wants to toggle color
  2305.                {
  2306.                if (color)
  2307.                  color = 0
  2308.                else
  2309.                  color = 1;
  2310.  
  2311.                fix_color();               // fix up ANSI driver
  2312.                }
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325.                                        Page 41
  2326.  
  2327.  
  2328.  
  2329.           GAP Communications                                         GAPCDR
  2330.  
  2331.  
  2332.           gapputc
  2333.           -----------------------------------------------------------------
  2334.  
  2335.           Purpose       Sends a single character to local and remote.
  2336.  
  2337.                         void gapputc(short ch);
  2338.  
  2339.                         ch         Character to send
  2340.  
  2341.           Type          Low Level
  2342.  
  2343.           Description   This is  one of  the main  output routines  that is
  2344.                         used internally  by GAPCDR.  It is part of the ANSI
  2345.                         driver. It  will send  a single  character  to  the
  2346.                         local screen  and if  a remote  caller is  on, will
  2347.                         send the  character to  the communications  port as
  2348.                         well.
  2349.  
  2350.           Return Value  None.
  2351.  
  2352.           Example       gapputc('A');        // display a character
  2353.  
  2354.              while ( (c = getakey()) == 0)   // wait for keypress
  2355.                dv_pause();                   // give up time slice
  2356.  
  2357.              gapputc(c);                     // display character
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.                                        Page 42
  2384.  
  2385.  
  2386.  
  2387.           GAP Communications                                         GAPCDR
  2388.  
  2389.  
  2390.           gapputs
  2391.           -----------------------------------------------------------------
  2392.  
  2393.           Purpose       Sends a string of characters to local and remote.
  2394.  
  2395.                         void gapputs(char *str);
  2396.  
  2397.                         str        String to send
  2398.  
  2399.           Type          Low Level
  2400.  
  2401.           Description   This is  one of  the main  output routines  that is
  2402.                         used internally  by GAPCDR.  It is part of the ANSI
  2403.                         driver. It  will send a string of characters to the
  2404.                         local screen  and if  a remote  caller is  on, will
  2405.                         send the string to the communications port as well.
  2406.                         If a  caller is  in mono mode, the ANSI driver will
  2407.                         strip any  ANSI sequences  from  the  string.  This
  2408.                         allows you  to "colorize"  your strings  with  ANSI
  2409.                         codes and  not have  to worry if the caller has his
  2410.                         color setting turned on.
  2411.  
  2412.                         This routine  is much  faster  than  show_mess  (in
  2413.                         fact, this  is the  function that show_mess calls),
  2414.                         but it  does not  provide for  ringing the  bell or
  2415.                         automatically sending  a carriage  return and  line
  2416.                         feed after  the string. You can however embed these
  2417.                         characters into  the string.  It is  suggested that
  2418.                         you not  embed the  bell character  into the string
  2419.                         since the  sysop may have the alarm toggled off and
  2420.                         may not  appreciate the  computer making noise when
  2421.                         he/she doesn't want it to.
  2422.  
  2423.           Return Value  None.
  2424.  
  2425.           Example       gapputs("This is a string of characters");
  2426.  
  2427.              // this example embeds the CR/LF pair at the beginning
  2428.              // and end of the string
  2429.  
  2430.              gapputs("\r\nThis is a string\r\n");
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.                                        Page 43
  2442.  
  2443.  
  2444.  
  2445.           GAP Communications                                         GAPCDR
  2446.  
  2447.  
  2448.           getakey
  2449.           -----------------------------------------------------------------
  2450.  
  2451.           Purpose       Gets one key responses
  2452.  
  2453.                         short getakey(void);
  2454.  
  2455.           Type          High Level
  2456.  
  2457.           Description   This is  the main  keyboard input  routine.  It  is
  2458.                         called  by  get_string  as  well  as  any  keyboard
  2459.                         polling loops. It checks the receive buffer as well
  2460.                         as the  local keyboard  for a  key press. If one is
  2461.                         not found  it returns 0. The character input is not
  2462.                         echoed. Since  99% of all keyboard input comes from
  2463.                         this  routine,   it  checks   for  time  remaining,
  2464.                         keyboard  time-out,   as  well   as  special  sysop
  2465.                         function keys.  The timeleft variable is updated by
  2466.                         this  routine.  This  is  the  variable  you  would
  2467.                         normally use in a prompt such as:
  2468.  
  2469.                                    [20 mins left] Main Command :
  2470.  
  2471.           Return Value  ASCII code for the key pressed or 0.
  2472.  
  2473.           Example       c = getakey();    // get a character
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.                                        Page 44
  2500.  
  2501.  
  2502.  
  2503.           GAP Communications                                         GAPCDR
  2504.  
  2505.  
  2506.           getkeyc
  2507.           -----------------------------------------------------------------
  2508.  
  2509.           Purpose       Gets keyboard character and scan code.
  2510.  
  2511.                         short getkeyc(void);
  2512.  
  2513.           Type          Low Level
  2514.  
  2515.           Description   This is  the main  keyboard input  routine which is
  2516.                         called  internally   by  getakey.  It  returns  the
  2517.                         keyboard character  or if  the key  struck  was  an
  2518.                         extended key,  it will  return a unique code. These
  2519.                         codes are  defined in  GAPSTRUC.H as F1, Home, etc.
  2520.                         This function  always waits  for a  keypress so  it
  2521.                         should not be called unless you know there is a key
  2522.                         waiting.
  2523.  
  2524.           Return Value  ASCII code for the key pressed or a unique code for
  2525.                         extended keys.
  2526.  
  2527.           Example       keyc = getkeyc(); // get a keyboard character
  2528.  
  2529.  
  2530.  
  2531.           get_attr
  2532.           -----------------------------------------------------------------
  2533.  
  2534.           Purpose       Retrieves the current screen color.
  2535.  
  2536.                         void get_attr(void);
  2537.  
  2538.           Type          Low Level
  2539.  
  2540.           Description   This function  is used  at  the  very  start  of  a
  2541.                         program to  "remember" the  screen color. It stores
  2542.                         the color  in a special location so that the screen
  2543.                         attributes  can  be  restored  by  the  DOS  Window
  2544.                         routines. You  do not  need to call this routine if
  2545.                         you have no plans to use the DOS Window.
  2546.  
  2547.           Return Value  None. Attribute is stored in an internal location.
  2548.  
  2549.           Example       get_attr();       // Remember screen attributes
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.                                        Page 45
  2558.  
  2559.  
  2560.  
  2561.           GAP Communications                                         GAPCDR
  2562.  
  2563.  
  2564.           get_random
  2565.           -----------------------------------------------------------------
  2566.  
  2567.           Purpose       Gets a random number.
  2568.  
  2569.                         short get_random(short low,short high);
  2570.  
  2571.                         low        Lowest number acceptible
  2572.                         high       Highest number acceptible
  2573.  
  2574.           Type          High Level
  2575.  
  2576.           Description   This routine  is provided because it is much easier
  2577.                         to use  and understand  than the  C library routine
  2578.                         (which  drags   in  the  floating  point  library).
  2579.                         Provide as  parameters,  two  integers.  The  first
  2580.                         parameter is the lowest number you will accept as a
  2581.                         random number,  and the  second  parameter  is  the
  2582.                         highest random number you will accept. The function
  2583.                         will return  a random  integer  between  the  range
  2584.                         specified (low  and high  are included in the range
  2585.                         of numbers). It is not necessary to seed the random
  2586.                         number generator  as this is done automatically for
  2587.                         you during program initialization.
  2588.  
  2589.           Return Value  A random number between range specified.
  2590.  
  2591.           Example       rndnum = get_random(1,10);     // get a random num
  2592.  
  2593.  
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599.  
  2600.  
  2601.  
  2602.  
  2603.  
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.  
  2611.  
  2612.  
  2613.  
  2614.  
  2615.                                        Page 46
  2616.  
  2617.  
  2618.  
  2619.           GAP Communications                                         GAPCDR
  2620.  
  2621.  
  2622.           get_string
  2623.           -----------------------------------------------------------------
  2624.  
  2625.           Purpose       Gets a string of characters.
  2626.  
  2627.                         void get_string(char *string);
  2628.  
  2629.                         string     Storage for input characters
  2630.  
  2631.           Type          High Level
  2632.  
  2633.           Description   This is  the main  input routine.  It  will  get  a
  2634.                         string from  either the  remote user  or the  local
  2635.                         keyboard. The  string passed  will be  set  to  the
  2636.                         characters received. The length of the input string
  2637.                         is determined by the length of the string passed.
  2638.  
  2639.                         Before calling,  you  must  initialize  the  passed
  2640.                         string with  spaces. The  number of  spaces in  the
  2641.                         string determines  the number of characters allowed
  2642.                         to be  input. If  a  user  attempts  to  type  more
  2643.                         characters than  allowed, the  cursor will not move
  2644.                         pass the  end of  the string.  Input ends  when the
  2645.                         Enter key is pressed.
  2646.  
  2647.                         To initialize the string, use the empty function.
  2648.  
  2649.                         WARNING : It is extremely important that the passed
  2650.                         string be initialized. Failure to set the string to
  2651.                         spaces, will cause unpredictable results!
  2652.  
  2653.                         This function  does not  return a  new string  con-
  2654.                         taining the  keyboard input.  Instead, it  modifies
  2655.                         the string  you pass  to it  in the parameter list.
  2656.                         The string will be stripped of any trailing spaces.
  2657.  
  2658.                         Get_string automatically  uppercases the string. If
  2659.                         you wish  to disable this feature, set the variable
  2660.                         noup to  1 just  prior to calling the function, and
  2661.                         then set it back to 0 when the function returns.
  2662.  
  2663.                         Get_string will  automatically check  for  keyboard
  2664.                         activity so it is not necessary for you to do so.
  2665.  
  2666.           Return Value  None
  2667.  
  2668.           Example       get_string(instr);   // get a string
  2669.  
  2670.  
  2671.  
  2672.  
  2673.                                        Page 47
  2674.  
  2675.  
  2676.  
  2677.           GAP Communications                                         GAPCDR
  2678.  
  2679.  
  2680.              char instr [20];
  2681.  
  2682.              // First initialize the string. In this case we will
  2683.              // accept up to 10 characters
  2684.  
  2685.              empty(instr,10);             // initialize string
  2686.              get_string(instr);           // get string
  2687.  
  2688.  
  2689.           init_ansi
  2690.           -----------------------------------------------------------------
  2691.  
  2692.           Purpose       Initialize ANSI driver.
  2693.  
  2694.                         void init_ansi(void);
  2695.  
  2696.           Type          Low Level
  2697.  
  2698.           Description   This routine  is called  by init_door  so it is not
  2699.                         necessary for  you to call it again. It sets up the
  2700.                         ANSI driver  so that  it knows  the sysop's default
  2701.                         color, the current cursor position, etc.
  2702.  
  2703.           Return Value  None.
  2704.  
  2705.           Example       init_ansi();      // Initialize ANSI driver
  2706.  
  2707.  
  2708.  
  2709.           init_com
  2710.           -----------------------------------------------------------------
  2711.  
  2712.           Purpose       To configure the communications port.
  2713.  
  2714.                         void init_com(void);
  2715.  
  2716.           Type          High Level
  2717.  
  2718.           Description   This function  takes the  information  provided  by
  2719.                         DOOR.SYS and  makes a call to setport to set up the
  2720.                         communications  port  and  receive  buffer.  It  is
  2721.                         called internally  by init_door.  If  there  is  an
  2722.                         error setting  up the  port, init_com will exit the
  2723.                         program.
  2724.  
  2725.           Return Value  None. Exits on Error.
  2726.  
  2727.           Example       init_com();       // Initialize com port
  2728.  
  2729.  
  2730.  
  2731.                                        Page 48
  2732.  
  2733.  
  2734.  
  2735.           GAP Communications                                         GAPCDR
  2736.  
  2737.  
  2738.           init_door
  2739.           -----------------------------------------------------------------
  2740.  
  2741.           Purpose       Initializes the GAPCDR functions.
  2742.  
  2743.                         void init_door(void);
  2744.  
  2745.           Type          High Level
  2746.  
  2747.           Description   This  routine  must  be  called  immediately  after
  2748.                         calling read_cnf.  It initializes  the door,  opens
  2749.                         and reads  system files,  initializes the com port,
  2750.                         initializes global  variables and in general, makes
  2751.                         sure that  all of  the files required for operation
  2752.                         are present.  If an  error occurs  while trying  to
  2753.                         initialize, the  function  will  display  an  error
  2754.                         message and end the program.
  2755.  
  2756.           Return Value  None. Exits on error.
  2757.  
  2758.           Example
  2759.  
  2760.              fp = read_cnf("DOOR.CNF");   // read cnf file
  2761.              init_door();                 // init the door
  2762.              fclose(fp);                  // close configuration file
  2763.  
  2764.  
  2765.           init_port
  2766.           -----------------------------------------------------------------
  2767.  
  2768.           Purpose       Initialize port to baud, data, and parity.
  2769.  
  2770.                         init_port(short parity, short data);
  2771.  
  2772.                         parity     0 = None, 1 = Even
  2773.                         data       6,7,or 8 data bits
  2774.  
  2775.           Type          Low Level
  2776.  
  2777.           Description   Sets the communications port to the parity and data
  2778.                         bits  passed   as  parameters.  The  baud  rate  is
  2779.                         contained in  a global  variabled called  baud. The
  2780.                         port  number   (where  COM  1  equals  port  0)  is
  2781.                         contained in a global variabled called port.
  2782.  
  2783.           RETURN VALUE  0 = SUCCESSFUL, 1 = ERROR.
  2784.  
  2785.           Example       init_port(0,8)    // Initialize to N,8,1
  2786.  
  2787.  
  2788.  
  2789.                                        Page 49
  2790.  
  2791.  
  2792.  
  2793.           GAP Communications                                         GAPCDR
  2794.  
  2795.  
  2796.           iscd
  2797.           -----------------------------------------------------------------
  2798.  
  2799.           Purpose       Check for Carrier on the Communications Port.
  2800.  
  2801.                         short iscd(void);
  2802.  
  2803.           Type          Low Level
  2804.  
  2805.           Description   This function allows you to test the communications
  2806.                         port for a remote carrier signal. Note that carrier
  2807.                         checking  is   performed   automatically   by   the
  2808.                         communications routines  so it is not necessary for
  2809.                         you to explicitly check for carrier unless you have
  2810.                         a need to override the default actions taken.
  2811.  
  2812.           Return Value  Returns 0  if there is no carrier and 1 if there is
  2813.                         a carrier.
  2814.  
  2815.           Example
  2816.  
  2817.              if ( !iscd())                // is there a carrier?
  2818.                leave(99);                 // nope, lets quit
  2819.  
  2820.  
  2821.           leave
  2822.           -----------------------------------------------------------------
  2823.  
  2824.           Purpose       Exits the program.
  2825.  
  2826.                         void leave(short code);
  2827.  
  2828.                         code       Exit code to terminate with
  2829.  
  2830.           Type          High Level
  2831.  
  2832.           Description   When the  program terminates,  it  must  call  this
  2833.                         function to  end. This is the only proper exit from
  2834.                         the door.  It is  of vital  importance to  end your
  2835.                         program through this function so that the interrupt
  2836.                         service  routines   that  are   installed  at  door
  2837.                         beginning can be removed.
  2838.  
  2839.           Return Value  None.
  2840.  
  2841.           Example       leave(0);       // Exit the program
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.                                        Page 50
  2848.  
  2849.  
  2850.  
  2851.           GAP Communications                                         GAPCDR
  2852.  
  2853.  
  2854.           lputc, lputs
  2855.           -----------------------------------------------------------------
  2856.  
  2857.           Purpose       To display  a character  or string of characters on
  2858.                         the local screen.
  2859.  
  2860.                         void lputc(char ch);
  2861.  
  2862.                         ch         Character to display
  2863.  
  2864.                         void lputs(char *str);
  2865.  
  2866.                         str        String to display
  2867.  
  2868.           Type          Low Level
  2869.  
  2870.           Description   Like gapputc  and gapputs,  these functions display
  2871.                         either  a   single  character   or  a   string   of
  2872.                         characters,  however   the   characters   are   not
  2873.                         simultaneously sent  to the  communications port as
  2874.                         well. These  functions override  the color  mode of
  2875.                         the caller  and allow you to send ANSI color to the
  2876.                         local screen  even if  the caller does not have his
  2877.                         color flag turned on.
  2878.  
  2879.           Return Value  None.
  2880.  
  2881.           Example       lputs("This is a string");     // Send string
  2882.  
  2883.  
  2884.  
  2885.           more
  2886.           -----------------------------------------------------------------
  2887.  
  2888.           Purpose       Checks for a full screen and issues a More Prompt.
  2889.  
  2890.                         void more(void);
  2891.  
  2892.           Type          High Level
  2893.  
  2894.           Description   This is  an internal  routine that is called by the
  2895.                         character output functions. It issues a more prompt
  2896.                         if the number of lines displayed reaches the user's
  2897.                         page length.
  2898.  
  2899.           Return Value  None.
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.                                        Page 51
  2906.  
  2907.  
  2908.  
  2909.           GAP Communications                                         GAPCDR
  2910.  
  2911.  
  2912.           nl
  2913.           -----------------------------------------------------------------
  2914.  
  2915.           Purpose       Sends a  Carriage Return and Line Feed to local and
  2916.                         remote.
  2917.  
  2918.                         void nl(short lines);
  2919.  
  2920.                         lines      Number of New Lines to send
  2921.  
  2922.           Type          High Level
  2923.  
  2924.           Description   To send  a blank  line, call  this routine with the
  2925.                         number of blank lines you wish to send.
  2926.  
  2927.           Return Value  None
  2928.  
  2929.           Example       nl(2);          // send two blank lines
  2930.  
  2931.  
  2932.  
  2933.           no_carrier
  2934.           -----------------------------------------------------------------
  2935.  
  2936.           Purpose       Used by the Communications routines.
  2937.  
  2938.                         void no_carrier(void);
  2939.  
  2940.           Type          High Level
  2941.  
  2942.           Description   Internal routine  that is  called when  there is  a
  2943.                         loss of  carrier. Displays  a message  to the local
  2944.                         screen  and  then  calls  leave  to  terminate  the
  2945.                         program. This  function must  not be  removed  from
  2946.                         GAPCDR. You  may modify  it to  change the  default
  2947.                         actions that  are  taken,  but  the  communications
  2948.                         routines must  have access to it if there is a loss
  2949.                         of carrier.
  2950.  
  2951.           Return Value  None.
  2952.  
  2953.           Example
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.                                        Page 52
  2964.  
  2965.  
  2966.  
  2967.           GAP Communications                                         GAPCDR
  2968.  
  2969.  
  2970.           pagesysop
  2971.           -----------------------------------------------------------------
  2972.  
  2973.           Purpose       Alerts sysop that user wants to chat.
  2974.  
  2975.                         void pagesysop(void);
  2976.  
  2977.           Type          High Level
  2978.  
  2979.           Description   Allows the  programer to  provide the  user with  a
  2980.                         Page Sysop  command. The  page lasts for 30 seconds
  2981.                         and can be aborted by typing CTRL-K. If the sysop's
  2982.                         page bell  is on,  the sysop's  speaker  will  also
  2983.                         sound. To  answer the  page, the sysop should press
  2984.                         CTRL-F10.
  2985.  
  2986.           Return Value  None.
  2987.  
  2988.           Example       pagesysop();      // tell sysop
  2989.  
  2990.              empty(response,1);           // initialize string
  2991.  
  2992.              get_string(response);        // get a response
  2993.  
  2994.              if (response[0] == 'P')      // wants to chat
  2995.                pagesysop();               // tell sysop
  2996.  
  2997.  
  2998.           pause
  2999.           -----------------------------------------------------------------
  3000.  
  3001.           Purpose       Sends a "Press [Any Key] To Continue" prompt.
  3002.  
  3003.                         void pause(void);
  3004.  
  3005.           Type          High Level
  3006.  
  3007.           Description   This function  sends a pause prompt and waits for a
  3008.                         key press.
  3009.  
  3010.           Return Value  None.
  3011.  
  3012.           Example       pause();        // display pause prompt
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.                                        Page 53
  3022.  
  3023.  
  3024.  
  3025.           GAP Communications                                         GAPCDR
  3026.  
  3027.  
  3028.           putkey
  3029.           -----------------------------------------------------------------
  3030.  
  3031.           Purpose       Used  by  chat  routines  to  keep  track  of  word
  3032.                         wrapping.
  3033.  
  3034.                         void putkey(short ch);
  3035.  
  3036.                         ch         Character to send
  3037.  
  3038.           Type          High Level
  3039.  
  3040.           Description   This is  the  main  output  routine  for  the  chat
  3041.                         functions. It  keeps track  of the  current column,
  3042.                         and decides when it is time to wrap a word.
  3043.  
  3044.           Return Value  None.
  3045.  
  3046.           Example
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.                                        Page 54
  3080.  
  3081.  
  3082.  
  3083.           GAP Communications                                         GAPCDR
  3084.  
  3085.  
  3086.           read_cnf
  3087.           -----------------------------------------------------------------
  3088.  
  3089.           Purpose       Reads the door configuration file.
  3090.  
  3091.                         FILE *read_cnf(char *path);
  3092.  
  3093.                         path       Full path and name of configuration file
  3094.  
  3095.           Type          High Level
  3096.  
  3097.           Description   Opens the  configuration file for the current door.
  3098.                         Normally the  passed parameter  is the  name of the
  3099.                         door with  a .CNF extension (it is assumed that the
  3100.                         file is in the same directory as the door program).
  3101.                         If an error occurs, the program ends immediately.
  3102.  
  3103.                         WARNING :  The first  four lines of this configura-
  3104.                         tion file  belong to  the GAPCDR  interface module.
  3105.                         You are  free to  use the  information, but the in-
  3106.                         formation contained  in the  first four  lines must
  3107.                         conform exactly to the following specifications.
  3108.  
  3109.                         The first  line of  this file is the full drive and
  3110.                         path to  the BBS  default directory.  This  is  the
  3111.                         directory where  the BBS created the DOOR.SYS file.
  3112.                         The second  line is  the name of the BBS. The third
  3113.                         line is  the IRQ  for the port, and the fourth line
  3114.                         is the Base Address for the port. If the sysop uses
  3115.                         Com Ports other than 1 or 2, then he must enter the
  3116.                         appropriate IRQ and BASE address so that GAPCDR can
  3117.                         properly open  the port.  If Com  ports 1  or 2 are
  3118.                         used, then  a 0  may be  entered on  both of  these
  3119.                         lines.
  3120.  
  3121.                         It is  the responsibility  of the  door  author  to
  3122.                         describe the  format of these four lines to the end
  3123.                         user.   If    your   door   program   requires   no
  3124.                         configuration parameters of its own, you can simply
  3125.                         distribute a  sample configuration  file with these
  3126.                         four lines already in it.
  3127.  
  3128.                         GAPCDR will  not close  this file after reading the
  3129.                         first four  lines. It  leaves the file open for the
  3130.                         programmer's use.  Remember that  you assign a FILE
  3131.                         pointer to  the return value so that you may access
  3132.                         the  file.   If  your  door  does  require  certain
  3133.                         configuration parameters, have your users place the
  3134.  
  3135.  
  3136.  
  3137.                                        Page 55
  3138.  
  3139.  
  3140.  
  3141.           GAP Communications                                         GAPCDR
  3142.  
  3143.  
  3144.                         parameters in the file starting with line 5. If you
  3145.                         use a  set up  program, be  sure that  your set  up
  3146.                         program writes the first four lines as specified.
  3147.  
  3148.                         After you  have called  read_cnf and  init_door, if
  3149.                         you  have   any  configuration   options   in   the
  3150.                         configuration file, you should use the stream input
  3151.                         routines to  read those  options. Then  fclose  the
  3152.                         file using  the FILE  pointer returned. Even if you
  3153.                         have no options to read, you must close the file.
  3154.  
  3155.                         WARNING :  You must  call this routine before using
  3156.                         any of  the GAPCDR  functions. After  calling  this
  3157.                         routine, you must call init_door.
  3158.  
  3159.           Return Value  FILE pointer.
  3160.  
  3161.           Example
  3162.  
  3163.              FILE *fp;                       // File pointer
  3164.  
  3165.              fp = read_cnf("TOURIST.CNF");   // read cnf file
  3166.              fclose(fp);                     // close the file
  3167.              init_door();                    // init the door
  3168.  
  3169.  
  3170.           read_doorsys
  3171.           -----------------------------------------------------------------
  3172.  
  3173.           Purpose       Reads the DOOR.SYS universal door interface file.
  3174.  
  3175.                         short read_doorsys(void);
  3176.  
  3177.           Type          High Level
  3178.  
  3179.           Description   Internal routine  called by  init_door.  Reads  the
  3180.                         DOOR.SYS file  and initializes any global variables
  3181.                         that depend on the information in that file.
  3182.  
  3183.           Return Value  0 = no error, 1 = error.
  3184.  
  3185.           Example       c = read_doorsys();
  3186.  
  3187.  
  3188.  
  3189.  
  3190.  
  3191.  
  3192.  
  3193.  
  3194.  
  3195.                                        Page 56
  3196.  
  3197.  
  3198.  
  3199.           GAP Communications                                         GAPCDR
  3200.  
  3201.  
  3202.           read_gapuser
  3203.           -----------------------------------------------------------------
  3204.  
  3205.           Purpose       Reads the GAP Communications USERS.DAT file.
  3206.  
  3207.                         short read_gapuser(char *path);
  3208.  
  3209.                         path       Full path and name of the USERS file
  3210.  
  3211.           Type          High Level
  3212.  
  3213.           Description   Reads the  user record  of the  current user in the
  3214.                         GAP USERS.DAT  file. The  record  is  read  into  a
  3215.                         structure variable  called gapuser. You must supply
  3216.                         the path  and name  to the  base part  of the  User
  3217.                         file. GAP  stores the  name of the User file in the
  3218.                         GAPBBS.CNF file  (which you  must  read  yourself).
  3219.                         Read_gapuser will add the .DAT extension.
  3220.  
  3221.           Return Value  0 = no error, 1 = error.
  3222.  
  3223.           Example       c = read_gapuser(userpath);
  3224.  
  3225.  
  3226.  
  3227.           read_pcbsys
  3228.           -----------------------------------------------------------------
  3229.  
  3230.           Purpose       Reads the PCBOARD.SYS file.
  3231.  
  3232.                         short read_pcbsys(void);
  3233.  
  3234.           Type          High Level
  3235.  
  3236.           Description   Reads the  PCBOARD.SYS system  file. The  record is
  3237.                         read into a structure variable called pcbsys.
  3238.  
  3239.           Return Value  0 = no error, 1 = error.
  3240.  
  3241.           Example       c = read_pcbsys();
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250.  
  3251.  
  3252.  
  3253.                                        Page 57
  3254.  
  3255.  
  3256.  
  3257.           GAP Communications                                         GAPCDR
  3258.  
  3259.  
  3260.           read_pcbuser
  3261.           -----------------------------------------------------------------
  3262.  
  3263.           Purpose       Reads the PCB USERS file.
  3264.  
  3265.                         short read_pcbuser(char *path);
  3266.  
  3267.                         path       Full path and name of the USERS file
  3268.  
  3269.           Type          High Level
  3270.  
  3271.           Description   Reads the  user record  of the  current user in the
  3272.                         PCB USERS file. The record is read into a structure
  3273.                         variable called  pcbuser. You  must supply the path
  3274.                         and name to the User file. PCB stores the path\name
  3275.                         of the User file in the PCBOARD.DAT file (which you
  3276.                         must read yourself).
  3277.  
  3278.           Return Value  0 = no error, 1 = error.
  3279.  
  3280.           Example       c = read_pcbuser(userpath);
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.  
  3308.  
  3309.  
  3310.  
  3311.                                        Page 58
  3312.  
  3313.  
  3314.  
  3315.           GAP Communications                                         GAPCDR
  3316.  
  3317.  
  3318.           read_score
  3319.           -----------------------------------------------------------------
  3320.  
  3321.           Purpose       Reads the score file and displays the results.
  3322.  
  3323.                         short read_score(char *datfile,char *message);
  3324.  
  3325.                         datfile    Path and name of data file to read
  3326.                         message    Message to display
  3327.  
  3328.           Type          High Level
  3329.  
  3330.           Description   This function  will read  the scoreboard  data file
  3331.                         for your door (if any) and display the results. You
  3332.                         pass as  parameters the  name of  the data  file to
  3333.                         read, and  a message  to display  at the top of the
  3334.                         scoreboard. The  message could  be  something  like
  3335.                         "Top 10 Players".
  3336.  
  3337.           Return Value  0 = scores read, 1 = no scores to read.
  3338.  
  3339.           Example       read_score("TOURIST.DAT","Top 10 Tourists");
  3340.  
  3341.              if (read_score("TOURIST.DAT","Top 10 Tourists"))
  3342.                {
  3343.                nl(1);
  3344.                ansi(BWHITE);
  3345.                show_mess("No one's made it Yet!",NO,YES);
  3346.                }
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.                                        Page 59
  3370.  
  3371.  
  3372.  
  3373.           GAP Communications                                         GAPCDR
  3374.  
  3375.  
  3376.           reset_port
  3377.           -----------------------------------------------------------------
  3378.  
  3379.           Purpose       Restores the Communications port.
  3380.  
  3381.                         void reset_port(void);
  3382.  
  3383.           Type          Low Level
  3384.  
  3385.           Description   This function  must be  called prior to exiting the
  3386.                         program. It  restores the  interrupt vector used by
  3387.                         the   communications   routines.   It   is   called
  3388.                         internally by  leave so it is not necessary for you
  3389.                         to explicitly invoke it.
  3390.  
  3391.           Return Value  None.
  3392.  
  3393.           Example       reset_port();     // Restore communications port
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.  
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409.  
  3410.  
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.                                        Page 60
  3428.  
  3429.  
  3430.  
  3431.           GAP Communications                                         GAPCDR
  3432.  
  3433.  
  3434.           restore_screen
  3435.           -----------------------------------------------------------------
  3436.  
  3437.           Purpose       Restores a previously saved portion of the screen.
  3438.  
  3439.                         void restore_screen(short topr, short topc,
  3440.                                             short botr, short botc,
  3441.                                             unsigned short memseg);
  3442.  
  3443.                         topr       Top row of screen
  3444.                         topc       Top left column of screen
  3445.                         botr       Bottom row of screen
  3446.                         botc       Bottom right column of screen
  3447.                         memseg     Segment of buffer to save to
  3448.  
  3449.           Type          Low Level
  3450.  
  3451.           Description   This function  allows you  to restore  a previously
  3452.                         saved portion of the screen. You supply the top row
  3453.                         and column  and  the  bottom  row  and  column  co-
  3454.                         ordinates of  the rectangle. All co-ordinates are 0
  3455.                         based. The  memseg is  the segment  address of  the
  3456.                         buffer that  a previous  call to  save_screen saved
  3457.                         the video contents to.
  3458.  
  3459.           Return Value  None.
  3460.  
  3461.           Example       restore_screen(3,8,16,71,dseg);
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.                                        Page 61
  3486.  
  3487.  
  3488.  
  3489.           GAP Communications                                         GAPCDR
  3490.  
  3491.  
  3492.           rest_cbreak
  3493.           -----------------------------------------------------------------
  3494.  
  3495.           Purpose       Restores the Ctrl-Break vector.
  3496.  
  3497.                         void rest_cbreak(void);
  3498.  
  3499.           Type          Low Level
  3500.  
  3501.           Description   This function  must be  called prior to exiting the
  3502.                         program. It  restores the  interrupt vector used by
  3503.                         the Ctrl-Break  routine. It is called internally by
  3504.                         leave so  it is not necessary for you to explicitly
  3505.                         invoke it.
  3506.  
  3507.           Return Value  None.
  3508.  
  3509.           Example       rest_cbreak();    // restore Ctrl-Break vector
  3510.  
  3511.  
  3512.  
  3513.           rest_int10
  3514.           -----------------------------------------------------------------
  3515.  
  3516.           Purpose       Restores the interrupt 10 (BIOS) vector.
  3517.  
  3518.                         void rest_int10(void);
  3519.  
  3520.           Type          Low Level
  3521.  
  3522.           Description   When setting  up  an  interrupt  10  BIOS  trap  to
  3523.                         protect a  DOS Window, this function must be called
  3524.                         when it is no longer necessary to protect a portion
  3525.                         of the screen.
  3526.  
  3527.           Return Value  None.
  3528.  
  3529.           Example       See the example for set_cord.
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.                                        Page 62
  3544.  
  3545.  
  3546.  
  3547.           GAP Communications                                         GAPCDR
  3548.  
  3549.  
  3550.           rts
  3551.           -----------------------------------------------------------------
  3552.  
  3553.           Purpose       Toggle the RTS line on and off.
  3554.  
  3555.                         void rts(short how)
  3556.  
  3557.                         how        0 = Turn RTS off.
  3558.                                    1 = Turn RTS on
  3559.  
  3560.           Type          Low Level
  3561.  
  3562.           Description   This routine  is used  to turn  the RTS line of the
  3563.                         communications port  on or  off.  Turning  RTS  off
  3564.                         (providing the modem supports hardware handshaking)
  3565.                         tells  the  modem  to  stop  sending  data  to  the
  3566.                         computer. It is typically toggled off while writing
  3567.                         a buffer of data to a disk.
  3568.  
  3569.           Return Value  None.
  3570.  
  3571.           Example       rts(0);         // Turn RTS off
  3572.  
  3573.  
  3574.  
  3575.           rxempty
  3576.           -----------------------------------------------------------------
  3577.  
  3578.           Purpose       To check if there are any characters in the receive
  3579.                         buffer.
  3580.  
  3581.                         short rxempty(void);
  3582.  
  3583.           Type          Low Level
  3584.  
  3585.           Description   This function  checks  the  communications  receive
  3586.                         buffer to  see if  there are any characters waiting
  3587.                         to be read.
  3588.  
  3589.           Return Value  Returns 1  if buffer  is  empty,  0  if  there  are
  3590.                         characters waiting to be read.
  3591.  
  3592.           Example
  3593.  
  3594.              while (rxempty())            // nothing happening
  3595.                dv_pause();                // give up time slice
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601.                                        Page 63
  3602.  
  3603.  
  3604.  
  3605.           GAP Communications                                         GAPCDR
  3606.  
  3607.  
  3608.           save_screen
  3609.           -----------------------------------------------------------------
  3610.  
  3611.           Purpose       Saves a portion of the screen.
  3612.  
  3613.                         void save_screen(short topr, short topc,
  3614.                                          short botr, short botc,
  3615.                                          unsigned short memseg);
  3616.  
  3617.                         topr       Top row of screen
  3618.                         topc       Top left column of screen
  3619.                         botr       Bottom row of screen
  3620.                         botc       Bottom right column of screen
  3621.                         memseg     Segment of buffer to save to
  3622.  
  3623.           Type          Low Level
  3624.  
  3625.           Description   This function  allows you  to  save  a  rectangular
  3626.                         portion of  the screen.  You supply the top row and
  3627.                         column and  the bottom  row and column co-ordinates
  3628.                         of the rectangle. All co-ordinates are 0 based. The
  3629.                         memseg is  the segment  address of a buffer to save
  3630.                         the video  contents to  and assumes your buffer was
  3631.                         allocated by  DOS (i.e.,  the offset portion of the
  3632.                         buffer begins at 0).
  3633.  
  3634.           Return Value  None.
  3635.  
  3636.           Example
  3637.  
  3638.              unsigned short dseg;
  3639.  
  3640.              dos_allocatemem(114,&dseg);  // get some memory
  3641.              save_screen(3,8,16,71,dseg); // save contents of video
  3642.  
  3643.  
  3644.  
  3645.  
  3646.  
  3647.  
  3648.  
  3649.  
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656.  
  3657.  
  3658.  
  3659.                                        Page 64
  3660.  
  3661.  
  3662.  
  3663.           GAP Communications                                         GAPCDR
  3664.  
  3665.  
  3666.           setport
  3667.           -----------------------------------------------------------------
  3668.  
  3669.           Purpose       Initialize the Communications Port.
  3670.  
  3671.                         short set_port(short bufsize, short irq,
  3672.                                        short base);
  3673.  
  3674.                         bufsize    Size of Receive buffer
  3675.                         irq        Port IRQ to use
  3676.                         base       Port Base Address to use
  3677.  
  3678.           Type          Low Level
  3679.  
  3680.           Description   This is  the port  initialization routine  that  is
  3681.                         called by  init_com. Bufsize  is the  size  of  the
  3682.                         receive buffer  to set  up. Set_port  will allocate
  3683.                         memory based  upon this  size. Typical  values  are
  3684.                         from 1200  to 4096  bytes. Note  that  the  bufsize
  3685.                         argument  is   ignored  when   using  the   Borland
  3686.                         compiler. This  is because Borland does not provide
  3687.                         a memory  allocation routine  that allocates memory
  3688.                         in the  near heap  (irregardless of  memory model).
  3689.                         For Borland,  the bufsize  is fixed  at 2048 bytes.
  3690.                         IRQ is  the Interrupt Request number to use for the
  3691.                         port and Base Address is the address where the port
  3692.                         is located.  The Port  number is  a global variable
  3693.                         that is set when reading DOOR.SYS. Ports start with
  3694.                         0, where  0 equals  COM 1, 1 equals COM 2, etc. For
  3695.                         COM 1  and COM  2, you may simply pass 0 as the IRQ
  3696.                         and Base address since the defaults for these ports
  3697.                         will be used.
  3698.  
  3699.           Return Value  0 = successful, 1 = error encountered.
  3700.  
  3701.           Example
  3702.  
  3703.              // set up the port with a buffer size of 2k, using COM 1
  3704.  
  3705.              port = 0;
  3706.  
  3707.              if (setport(2048, 0, 0))
  3708.                exit(1);
  3709.  
  3710.  
  3711.  
  3712.  
  3713.  
  3714.  
  3715.  
  3716.  
  3717.                                        Page 65
  3718.  
  3719.  
  3720.  
  3721.           GAP Communications                                         GAPCDR
  3722.  
  3723.  
  3724.           set_attr
  3725.           -----------------------------------------------------------------
  3726.  
  3727.           Purpose       Sets the video color attributes.
  3728.  
  3729.                         void set_attr(unsigned  char  forg,  unsigned  char
  3730.                         back);
  3731.  
  3732.                         forg       Foreground Color (0-15)
  3733.                         back       Background Color (0-7)
  3734.  
  3735.           Type          Low Level
  3736.  
  3737.           Description   This function  is used just prior to invoking a DOS
  3738.                         Window so that the window colors can be set.
  3739.  
  3740.           Return Value  None.
  3741.  
  3742.           Example       See the example for set_cord.
  3743.  
  3744.  
  3745.  
  3746.           set_cbreak
  3747.           -----------------------------------------------------------------
  3748.  
  3749.           Purpose       Initializes the Ctrl-Break vector.
  3750.  
  3751.                         void set_cbreak(void);
  3752.  
  3753.           Type          Low Level
  3754.  
  3755.           Description   To trap Ctrl-C and Ctrl-Break, this function should
  3756.                         be called to set up an interrupt service routine to
  3757.                         trap these  two keys.  It is  imperitive  that  the
  3758.                         program not exit before calling rest_cbreak so that
  3759.                         the interrupt  vector can  be restored.  Leave does
  3760.                         this for you automatically.
  3761.  
  3762.           Return Value  None.
  3763.  
  3764.           Example       set_cbreak();     // set up Ctrl-Break ISR
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771.  
  3772.  
  3773.  
  3774.  
  3775.                                        Page 66
  3776.  
  3777.  
  3778.  
  3779.           GAP Communications                                         GAPCDR
  3780.  
  3781.  
  3782.           set_cord
  3783.           -----------------------------------------------------------------
  3784.  
  3785.           Purpose       Set up a DOS Window.
  3786.  
  3787.                         void set_cord(unsigned char topr,
  3788.                                       unsigned char topc,
  3789.                                       unsigned char botr,
  3790.                                       unsigned char botc);
  3791.  
  3792.                         topr       Top left row
  3793.                         topc       Top left column
  3794.                         botr       Bottom row
  3795.                         botc       Bottom right column
  3796.  
  3797.           Type          Low Level
  3798.  
  3799.           Description   This function  sets the  window co-ordinates  for a
  3800.                         DOS Window. Using this function in combination with
  3801.                         set_int10 allows  you to set up a window into which
  3802.                         all local  screen output will be directed. Topr and
  3803.                         topc are the top left corner of the window and botr
  3804.                         and botc are the bottom right corner of the window.
  3805.                         All co-ordinates are 0 based.
  3806.  
  3807.           Return Value  None.
  3808.  
  3809.           Example
  3810.  
  3811.              _dos_allocmem(114,&dseg);       // get some memory
  3812.              save_screen(3,8,16,71,dseg);    // save a part of screen
  3813.              set_int10();                    // set up BIOS trap
  3814.              set_cord(4,9,15,70);            // tell it what to protect
  3815.              set_attr(14,1);                 // Yellow on Blue
  3816.              cls_all();                      // clear the window
  3817.              system("COMMAND");              // go to DOS
  3818.              rest_int10();                   // restore vector
  3819.              restore_screen(3,8,16,71,dseg); // restore screen
  3820.              _dos_freemem(dseg);             // free memory
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.                                        Page 67
  3834.  
  3835.  
  3836.  
  3837.           GAP Communications                                         GAPCDR
  3838.  
  3839.  
  3840.           set_int10
  3841.           -----------------------------------------------------------------
  3842.  
  3843.           Purpose       Set up an interrupt 10 (BIOS) trapper.
  3844.  
  3845.                         void set_int10(void);
  3846.  
  3847.           Type          Low Level
  3848.  
  3849.           Description   This function intercepts the Interrupt 10 vector so
  3850.                         that it  can trap  calls to  the BIOS  video output
  3851.                         routines. It  is used  in conjunction with set_cord
  3852.                         to set  up a  portion of  the screen into which all
  3853.                         video output  through the BIOS will be directed. If
  3854.                         a console driver other than CON or ANSI.SYS is used
  3855.                         that writes  directly to  the screen, this function
  3856.                         will not work.
  3857.  
  3858.           Return Value  None.
  3859.  
  3860.           Example       See the example for set_cord.
  3861.  
  3862.  
  3863.  
  3864.           set_status
  3865.           -----------------------------------------------------------------
  3866.  
  3867.           Purpose       Displays and updates the sysop status line.
  3868.  
  3869.                         void set_status(short how);
  3870.  
  3871.                         how        0 = set the status line
  3872.                                    1 = update the status line
  3873.                                    4 = show other user stats
  3874.  
  3875.  
  3876.           Type          High Level
  3877.  
  3878.           Description   Displays or updates the sysop status line.
  3879.  
  3880.           Return Value  None.
  3881.  
  3882.           Example       set_status(0);    // display status line
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.                                        Page 68
  3892.  
  3893.  
  3894.  
  3895.           GAP Communications                                         GAPCDR
  3896.  
  3897.  
  3898.           show_file
  3899.           -----------------------------------------------------------------
  3900.  
  3901.           Purpose       Displays a text file.
  3902.  
  3903.                         void show_file(char *filename);
  3904.  
  3905.                         filename   Full path and name of file to display
  3906.  
  3907.           Type          High Level
  3908.  
  3909.           Description   Many door  programs have  welcome, news, exit, help
  3910.                         and other  files to  show to  the user  at  various
  3911.                         points in  the program.  This is  the function that
  3912.                         allows you  to do  that. To  display a  file to the
  3913.                         user,   call    the   function    with   the   full
  3914.                         drive\path\filename of the file to display.
  3915.  
  3916.                         If you  have color  and non-color versions of files
  3917.                         pass the  name of  the non-color  version  as  this
  3918.                         function will  automatically append  a "G"  to  the
  3919.                         filename if  the user  is in  color mode.  In fact,
  3920.                         this function will always try to find a file with a
  3921.                         "G" appended to the end of the name (if the user is
  3922.                         in color  mode) before it looks for the actual file
  3923.                         by the  name you  specified. If you pass "WELCOMEG"
  3924.                         to this  function and the user is in color mode, it
  3925.                         will first  try to  find a  file with  the name  of
  3926.                         "WELCOMEGG".
  3927.  
  3928.                         Pressing CTRL-K  or  CTRL-X  will  abort  any  file
  3929.                         display.
  3930.  
  3931.                         REMEMBER :  If you  have both  color and  non-color
  3932.                         versions of  the same  files, pass  the name of the
  3933.                         non-color version. Also, the actual disk files must
  3934.                         be named  in such  a way  that they  have  no  file
  3935.                         extension and the color version ends with a "G".
  3936.  
  3937.           Return Value  None.
  3938.  
  3939.           Example       show_file("WELCOME");     // display welcome file
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.                                        Page 69
  3950.  
  3951.  
  3952.  
  3953.           GAP Communications                                         GAPCDR
  3954.  
  3955.  
  3956.           show_mess
  3957.           -----------------------------------------------------------------
  3958.  
  3959.           Purpose       Displays a message.
  3960.  
  3961.                         void show_mess(char *message,short bell,
  3962.                                        short newline);
  3963.  
  3964.                         message    Message to display.
  3965.                         bell       YES or NO to ring the bell.
  3966.                         newline    YES or NO to issue a CR/LF after
  3967.                                    message.
  3968.  
  3969.           Type          High Level
  3970.  
  3971.           Description   This is the main string output function for GAPCDR.
  3972.                         Under most circumstances, this is the only function
  3973.                         that you would call to display output to the user.
  3974.  
  3975.           Return Value  None
  3976.  
  3977.           Example       show_mess("This is a message!",NO,YES);
  3978.  
  3979.              // the first show_mess displays the string and leaves the
  3980.              // cursor on the same line. The second displays the
  3981.              // string, rings the remote user's bell, and drops the
  3982.              // cursor to the next line.
  3983.  
  3984.              nl(1);
  3985.              show_mess("Are you ready? (Y/N) : ",NO,NO);
  3986.  
  3987.              empty(response,3);
  3988.              get_string(response);
  3989.  
  3990.              if (response[0] == 'Y')
  3991.                // begin whatever it is you want to begin
  3992.              else
  3993.                show_mess("Too Bad!",YES,YES);
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.                                        Page 70
  4008.  
  4009.  
  4010.  
  4011.           GAP Communications                                         GAPCDR
  4012.  
  4013.  
  4014.           timer
  4015.           -----------------------------------------------------------------
  4016.  
  4017.           Purpose       Pauses for the number of "ticks" specified.
  4018.  
  4019.                         void timer(short ticks);
  4020.  
  4021.                         ticks      Number of timer ticks to pause.
  4022.  
  4023.           Type          High Level
  4024.  
  4025.           Description   This function  allows you  to pause  all processing
  4026.                         for the  specified  number  of  ticks.  It  is  in-
  4027.                         sensitive to processor speed.
  4028.  
  4029.                         The function  simply delays  the number  of "ticks"
  4030.                         indicated by  the passed  parameter. Each  tick  is
  4031.                         1/18 of a second (or 55 miliseconds).
  4032.  
  4033.           Return Value  None.
  4034.  
  4035.           Example       timer(18);      // pause for 1 second
  4036.  
  4037.  
  4038.  
  4039.  
  4040.  
  4041.  
  4042.  
  4043.  
  4044.  
  4045.  
  4046.  
  4047.  
  4048.  
  4049.  
  4050.  
  4051.  
  4052.  
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.                                        Page 71
  4066.  
  4067.  
  4068.  
  4069.           GAP Communications                                         GAPCDR
  4070.  
  4071.  
  4072.           time_credit
  4073.           -----------------------------------------------------------------
  4074.  
  4075.           Purpose       Issues timecredits to user.
  4076.  
  4077.                         void time_credit(short flag);
  4078.  
  4079.                         flag       1 = start timer
  4080.                                    0 = end timer
  4081.  
  4082.  
  4083.           Type          High Level
  4084.  
  4085.           Description   This is  basically an  internal routine  called  by
  4086.                         chat and sysop shell to DOS so that the user is not
  4087.                         penalized  for  time  used.  It  updates  a  global
  4088.                         variable called  timecredit. Timecredit  is used in
  4089.                         the calculations  that determine  the  user's  time
  4090.                         remaining.
  4091.  
  4092.                         If you  wish to  use this  feature in your own rou-
  4093.                         tines,  prior   to  entering   your  routine,  call
  4094.                         time_credit with  a 1  and it will start the timer.
  4095.                         When your  routine is  finished,  call  time_credit
  4096.                         with a  0 and  the timer  will stop.  The  variable
  4097.                         timecredit will be updated with the elapsed time.
  4098.  
  4099.           Return Value  None.
  4100.  
  4101.           Example       time_credit(1);   // start the timer
  4102.  
  4103.              time_credit(1);              // start the timer
  4104.              do_chat();                   // chat with user
  4105.              time_credit(0);              // stop the timer
  4106.  
  4107.  
  4108.  
  4109.  
  4110.  
  4111.  
  4112.  
  4113.  
  4114.  
  4115.  
  4116.  
  4117.  
  4118.  
  4119.  
  4120.  
  4121.  
  4122.  
  4123.                                        Page 72
  4124.  
  4125.  
  4126.  
  4127.           GAP Communications                                         GAPCDR
  4128.  
  4129.  
  4130.           time_left
  4131.           -----------------------------------------------------------------
  4132.  
  4133.           Purpose       To compute the user's time remaining.
  4134.  
  4135.                         void time_left(void);
  4136.  
  4137.           Type          High Level
  4138.  
  4139.           Description   This is  the function  that is  called by the input
  4140.                         and output  routines to  compute  the  user's  time
  4141.                         remaining. It  is not  necessary for the programmer
  4142.                         to call this routine directly.
  4143.  
  4144.                         A global  variable called  timeleft will be updated
  4145.                         with each  call.  This  variable  may  be  used  in
  4146.                         prompts that display the user's remaining time.
  4147.  
  4148.                         As long as all input/output is performed thru calls
  4149.                         to the  GAPCDR library,  the timeleft variable will
  4150.                         always be current.
  4151.  
  4152.           Return Value  None.
  4153.  
  4154.           Example       time_left();      // calculate time remaining
  4155.  
  4156.  
  4157.  
  4158.           trim
  4159.           -----------------------------------------------------------------
  4160.  
  4161.           Purpose       Trims  spaces  from  the  end  of  NULL  terminated
  4162.                         strings.
  4163.  
  4164.                         char *trim(char *string);
  4165.  
  4166.                         string     String containing trailing spaces
  4167.  
  4168.           Type          High Level
  4169.  
  4170.           Description   This function  will remove  any spaces from the end
  4171.                         of a string. It modifies the passed string.
  4172.  
  4173.           Return Value  Pointer to the string without the spaces.
  4174.  
  4175.           Example       trim(username);      // get rid of spaces
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.                                        Page 73
  4182.  
  4183.  
  4184.  
  4185.           GAP Communications                                         GAPCDR
  4186.  
  4187.  
  4188.           update_clock
  4189.           -----------------------------------------------------------------
  4190.  
  4191.           Purpose       Updates the status line clock.
  4192.  
  4193.                         void update_clock(void);
  4194.  
  4195.           Type          High Level
  4196.  
  4197.           Description   Internal routine to update the status line clock.
  4198.  
  4199.           Return Value  None.
  4200.  
  4201.           Example
  4202.  
  4203.  
  4204.  
  4205.           wrap_word
  4206.           -----------------------------------------------------------------
  4207.  
  4208.           Purpose       To wrap a word during sysop chats.
  4209.  
  4210.                         void wrap_word(void);
  4211.  
  4212.           Type          Low Level
  4213.  
  4214.           Description   Internal function called by putkey to wrap words.
  4215.  
  4216.           Return Value  None.
  4217.  
  4218.           Example
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.  
  4234.  
  4235.  
  4236.  
  4237.  
  4238.  
  4239.                                        Page 74
  4240.  
  4241.  
  4242.  
  4243.           GAP Communications                                         GAPCDR
  4244.  
  4245.  
  4246.           write_gapuser
  4247.           -----------------------------------------------------------------
  4248.  
  4249.           Purpose       Updates the user record in GAP's USERS.DAT file.
  4250.  
  4251.                         short write_gapuser(char *path);
  4252.  
  4253.                         path       Full path and name of Users File
  4254.  
  4255.           Type          High Level
  4256.  
  4257.           Description   This function allows you to update any variables in
  4258.                         the GAP  USERS.DAT file  for the  current user. You
  4259.                         must first  read the  user record  before  you  can
  4260.                         write to it.
  4261.  
  4262.                         You must  pass the path and name of the Users file.
  4263.                         The  name   is  obtained   by  reading  GAPBBS.CNF.
  4264.                         Write_gapuser will add the .DAT extension.
  4265.  
  4266.                         WARNING :  The GAP  USERS.DAT file contains strings
  4267.                         that are  fully padded  with spaces.  If you modify
  4268.                         any of  these strings,  you MUST make sure that the
  4269.                         string is  fully padded  with spaces  and that  the
  4270.                         NULL character  is placed  in the last string posi-
  4271.                         tion.
  4272.  
  4273.                         WARNING : The indexes for the user file consists of
  4274.                         the user's  last name and first name, user's level,
  4275.                         and user's  handle. Do  not under any circumstances
  4276.                         modify either  of these  four fields. Doing so will
  4277.                         cause corruption of the Index file.
  4278.  
  4279.           Return Value  0 = no error, 1 = error.
  4280.  
  4281.           Example       c = write_gapuser(userpath);
  4282.  
  4283.              // allow user to change city and state
  4284.  
  4285.              c = read_gapuser(userpath);
  4286.  
  4287.              if (c == 0)
  4288.                {
  4289.                show_mess("Enter City/State : ",NO,NO);
  4290.  
  4291.                empty(city,29);            // clear string
  4292.                get_string(city);          // get response
  4293.  
  4294.  
  4295.  
  4296.  
  4297.                                        Page 75
  4298.  
  4299.  
  4300.  
  4301.           GAP Communications                                         GAPCDR
  4302.  
  4303.  
  4304.                if (city[0] != 0)          // if something entered
  4305.                  {
  4306.                  strcpy(user.city,city);  // copy it
  4307.                  pad(user.city,29);       // pad it with spaces
  4308.                  c = write_gapuser(userpath);     // update user record
  4309.  
  4310.                  if (c == 0)
  4311.                    show_mess("Saved new City",NO,YES);
  4312.                  }
  4313.                }
  4314.  
  4315.  
  4316.           write_pcbsys
  4317.           -----------------------------------------------------------------
  4318.  
  4319.           Purpose       Updates the PCBOARD.SYS file.
  4320.  
  4321.                         short write_pcbsys(void);
  4322.  
  4323.           Type          High Level
  4324.  
  4325.           Description   This function  allows the  programmer to update the
  4326.                         PCBOARD.SYS File.  You must  first  read  the  file
  4327.                         before you  write to it and you should not use this
  4328.                         function unless  you  know  that  your  program  is
  4329.                         running with PCB as the host system.
  4330.  
  4331.           Return Value  0 = no error, 1 = error.
  4332.  
  4333.           Example       c = write_pcbsys()   // write the file
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.                                        Page 76
  4356.  
  4357.  
  4358.  
  4359.           GAP Communications                                         GAPCDR
  4360.  
  4361.  
  4362.           write_pcbuser
  4363.           -----------------------------------------------------------------
  4364.  
  4365.           Purpose       Updates the PCB USERS file.
  4366.  
  4367.                         short write_pcbuser(char *path);
  4368.  
  4369.                         path       Full path and name to the Users file
  4370.  
  4371.           Type          High Level
  4372.  
  4373.           Description   This function  allows the  programmer to update the
  4374.                         PCB USERS  File. Do  not use  unless you  know your
  4375.                         program is  running under  a PCB  host system.  You
  4376.                         must first  read the  user record  before  you  can
  4377.                         write to it.
  4378.  
  4379.                         You must  pass the path and name of the Users file.
  4380.                         The name is obtained by reading PCBOARD.DAT.
  4381.  
  4382.           Return Value  0 = no error, 1 = error.
  4383.  
  4384.           Example       c = write_pcbuser(); // write the file
  4385.  
  4386.  
  4387.  
  4388.  
  4389.  
  4390.  
  4391.  
  4392.  
  4393.  
  4394.  
  4395.  
  4396.  
  4397.  
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.                                        Page 77
  4414.  
  4415.  
  4416.  
  4417.           GAP Communications                                         GAPCDR
  4418.  
  4419.  
  4420.           write_score
  4421.           -----------------------------------------------------------------
  4422.  
  4423.           Purpose       Creates and maintains a scoreboard.
  4424.  
  4425.                         void write_score(char *filename,long score);
  4426.  
  4427.                         filename   Path and name of data file to write to
  4428.                         score      Score to write
  4429.  
  4430.           Type          High Level
  4431.  
  4432.           Description   This function will create and maintain a scoreboard
  4433.                         of the top ten players. You pass it two parameters.
  4434.                         The first  is a  string containing  the name of the
  4435.                         data file  to create/maintain. The second is a long
  4436.                         unsigned integer containing the score to write. The
  4437.                         user's name and the current date are already known.
  4438.                         If the  sysop is  in the  door  at  the  time,  the
  4439.                         function will  simply return and not write a score.
  4440.                         The  scores   will  automatically   be  sorted   in
  4441.                         decreasing order  by the highest score. If you wish
  4442.                         to use  this routine  but your  points are  kept as
  4443.                         shorts instead  of longs,  simply cast  the  second
  4444.                         parameter to an unsigned long.
  4445.  
  4446.           Return Value  None.
  4447.  
  4448.           Example
  4449.  
  4450.              short points;
  4451.  
  4452.              points = 1000;
  4453.              write_score("TOURIST.DAT,(unsigned long) points);
  4454.  
  4455.  
  4456.  
  4457.  
  4458.  
  4459.  
  4460.  
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.  
  4469.  
  4470.  
  4471.                                        Page 78
  4472.  
  4473.  
  4474.  
  4475.           GAP Communications                                         GAPCDR
  4476.  
  4477.  
  4478.           Index
  4479.  
  4480.  
  4481.           Access1  25, 27
  4482.           Alarm  21
  4483.           Ansi  25, 27
  4484.           Ansi driver
  4485.             color  7, 41, 43, 51
  4486.             external  15, 18
  4487.             initializing  10, 48
  4488.             internal  7, 11, 41
  4489.           ANSI variables  8, 20
  4490.           Anystring  24
  4491.           Backspace  24, 25, 28
  4492.           Base address  9, 14, 23, 55, 65
  4493.           Base_add  23, 55, 65
  4494.           Batch file  14
  4495.           Baud  16, 17, 18, 21, 49
  4496.           Baud rate  6, 16, 17, 18, 21, 49, 65
  4497.           BBS
  4498.             default directory  24, 55
  4499.             name  24
  4500.             system files  13, 24, 57, 58, 75, 76, 77
  4501.           Bbs_dir  24, 55
  4502.           Bell  21, 70
  4503.           Birthday  24
  4504.           Board_name  24
  4505.           Bphone  22
  4506.           BS  24
  4507.           Business phone number  22
  4508.           Caller alarm  21
  4509.           Caller's birth date  24
  4510.           Carriage return  24
  4511.           Carrier  16, 17, 50, 52
  4512.           Characters
  4513.             sending to com port  25, 32
  4514.             sending to local & remote  25, 42
  4515.             sending to local screen  25, 51
  4516.           Chat  15, 23, 35, 54
  4517.           Chatting with user  23
  4518.           City  22
  4519.           Ckeypress  25, 28
  4520.           Clear_scrn  25, 29
  4521.           Clockon  23, 74
  4522.           Clr_buf  25, 29
  4523.           Cls  25, 29, 30
  4524.           Cls_all  25, 30
  4525.           Color  7, 18, 21, 23, 27, 41, 43, 45, 51, 66
  4526.  
  4527.  
  4528.  
  4529.                                        Page 79
  4530.  
  4531.  
  4532.  
  4533.           GAP Communications                                         GAPCDR
  4534.  
  4535.  
  4536.           Column  23
  4537.           Comgetc  18, 25, 31
  4538.           Comgetd  18, 25, 31
  4539.           Communications
  4540.             advanced applications  16
  4541.             base address  9, 14, 23, 55, 65
  4542.             baud rates  6, 16, 17, 18, 21, 65
  4543.             carrier  16, 17, 50, 52
  4544.             configuration file  9
  4545.             DTR  18
  4546.             FIFO buffers  6
  4547.             Functions
  4548.               clr_buf  25, 29
  4549.               comgetc  25, 31
  4550.               comgetd  25, 31
  4551.               computb  25, 32
  4552.               computc  25, 32
  4553.               computs  25, 33
  4554.               dtr  25, 36
  4555.               init_port  17, 18, 25, 49
  4556.               iscd  25, 50
  4557.               no_carrier  25, 52
  4558.               reset_port  17, 26, 60
  4559.               rts  26, 63
  4560.               rxempty  26, 63
  4561.               setport  17, 26, 65
  4562.             initializing  17, 48, 49, 65
  4563.             input  18, 31, 63
  4564.             interrupt  10, 17, 50, 60
  4565.             IRQ  9, 14, 23, 55, 65
  4566.             output  18, 32, 33
  4567.             port  10, 11, 16, 21, 55, 65
  4568.           Compilers
  4569.             compiling & linking  11
  4570.             cputs  11
  4571.             floating point  8, 12, 46
  4572.             function calling  12
  4573.             goto  12
  4574.             header files  8, 45
  4575.             printf  11
  4576.             Quick C  12
  4577.             supported  8
  4578.           Compiling  11
  4579.           Computb  25, 32
  4580.           Computc  18, 25, 32
  4581.           Computs  18, 25, 33
  4582.           Configuration file  9, 10, 14, 55
  4583.             format  9, 14
  4584.  
  4585.  
  4586.  
  4587.                                        Page 80
  4588.  
  4589.  
  4590.  
  4591.           GAP Communications                                         GAPCDR
  4592.  
  4593.  
  4594.           Control characters  8
  4595.             editor  8
  4596.           Cputs  11
  4597.           CRLF  24, 43
  4598.           Ctrl-Break handler  10, 62, 66
  4599.           Curbytes  22
  4600.           Curfiles  21
  4601.           Current display color  23
  4602.           Current download bytes  22
  4603.           Current files downloaded  21
  4604.           Current time  23
  4605.           Cursoff  25, 33
  4606.           Curson  25, 34
  4607.           Cursor  25, 33, 34
  4608.           Curtime  24
  4609.           Date user's subscription expires  22
  4610.           Default color  21
  4611.           Delaying  71
  4612.           DESQview  16, 17, 25, 28, 31, 37, 38, 39
  4613.           Dflt_color  21
  4614.           Display clock  23
  4615.           Display color  23
  4616.           Distribution files  7
  4617.           Do_chat  25, 35
  4618.           DOOR.SYS  7, 9, 11, 13, 24, 56
  4619.             Universal format  7
  4620.             Variables  21
  4621.           Doors  14
  4622.           Doors opened  22
  4623.           Doors_opened  22
  4624.           DOS shell  15, 18
  4625.           DOS Window  18, 45, 61, 62, 64, 66, 67, 68
  4626.           Downbytes  22
  4627.           Download bytes  22
  4628.           Downloads  22
  4629.           DSZ  18
  4630.           DTR  18, 25, 36
  4631.           Dv_here  16, 25, 37
  4632.           Dv_pause  16, 25, 28, 38, 39
  4633.           Editor  8
  4634.             control characters  8
  4635.           Elap_time  25, 39
  4636.           Empty  25, 40, 47
  4637.           Endview  23
  4638.           Event_time  22
  4639.           Expert  21
  4640.           Files
  4641.             checking for existence of  25, 27
  4642.  
  4643.  
  4644.  
  4645.                                        Page 81
  4646.  
  4647.  
  4648.  
  4649.           GAP Communications                                         GAPCDR
  4650.  
  4651.  
  4652.             configuration  9, 14
  4653.             displaying  23, 69
  4654.             DOOR.SYS  7, 9, 13
  4655.             GAPCDR.H  8, 10
  4656.             GAPSTRUC.H  8
  4657.             PCBOARD.SYS  13
  4658.           First name  22
  4659.           Fix_color  25, 41
  4660.           Flag  23
  4661.           Floating point  8, 12, 46
  4662.           Fname  22
  4663.           Full name  22
  4664.           Function calling  12
  4665.           Function keys  15
  4666.           Functions
  4667.             access1  25, 27
  4668.             ansi  27
  4669.             backspace  28
  4670.             ckeypress  28
  4671.             clear_scrn  29
  4672.             clr_buf  29
  4673.             cls  29, 30
  4674.             cls_all  30
  4675.             comgetc  18, 31
  4676.             comgetd  18, 31
  4677.             computb  32
  4678.             computc  18, 32
  4679.             computs  18, 33
  4680.             cursoff  33
  4681.             curson  34
  4682.             do_chat  35
  4683.             DOS Window  18
  4684.             dtr  36
  4685.             dv_here  16, 37
  4686.             dv_pause  16, 38
  4687.             elap_time  39
  4688.             empty  40, 47
  4689.             fix_color  41
  4690.             gapputc  42
  4691.             gapputs  43
  4692.             get_attr  18, 45
  4693.             get_random  46
  4694.             get_string  40, 47
  4695.             getakey  44
  4696.             getkeyc  45
  4697.             init_ansi  48
  4698.             init_com  48
  4699.             init_door  9, 10, 49
  4700.  
  4701.  
  4702.  
  4703.                                        Page 82
  4704.  
  4705.  
  4706.  
  4707.           GAP Communications                                         GAPCDR
  4708.  
  4709.  
  4710.             init_port  17, 18, 49
  4711.             iscd  50
  4712.             leave  10, 50
  4713.             lputc  51
  4714.             lputs  51
  4715.             more  51
  4716.             nl  52
  4717.             no_carrier  16, 52
  4718.             pagesysop  53
  4719.             pause  53
  4720.             putkey  54
  4721.             read_cnf  9, 10, 55
  4722.             read_doorsys  56
  4723.             read_gapuser  11, 57
  4724.             read_pcbsys  11, 57
  4725.             read_pcbuser  58
  4726.             read_score  59
  4727.             reset_port  17, 60
  4728.             rest_cbreak  62
  4729.             rest_int10  62
  4730.             restore_screen  61
  4731.             rts  63
  4732.             rxempty  63
  4733.             save_screen  64
  4734.             set_attr  66
  4735.             set_cbreak  66
  4736.             set_cord  67
  4737.             set_int10  68
  4738.             set_port  17
  4739.             set_status  68
  4740.             setport  65
  4741.             show_file  69
  4742.             show_mess  43, 70
  4743.             time_credit  72
  4744.             time_left  73
  4745.             timer  16, 71
  4746.             trim  73
  4747.             update_clock  74
  4748.             wrap_word  74
  4749.             write_gapuser  75
  4750.             write_pcbsys  76
  4751.             write_pcbuser  77
  4752.             write_score  78
  4753.           GAPCDR.H  10
  4754.           Gapputc  25, 42
  4755.           Gapputs  25, 43
  4756.           GAPSTRUC.H  8, 45
  4757.           Gendir  24
  4758.  
  4759.  
  4760.  
  4761.                                        Page 83
  4762.  
  4763.  
  4764.  
  4765.           GAP Communications                                         GAPCDR
  4766.  
  4767.  
  4768.           Get_attr  18, 25, 45
  4769.           Get_random  25, 46
  4770.           Get_string  25, 40, 47
  4771.           Getakey  25, 44
  4772.           Getkeyc  25, 45
  4773.           Gotdv  16
  4774.           Goto  12
  4775.           Handle  22
  4776.           Header files
  4777.             GAPCDR.H  8, 10
  4778.             GAPSTRUC.H  8, 45
  4779.           Home phone number  22
  4780.           Hphone  22
  4781.           Init_ansi  25, 48
  4782.           Init_com  25, 48
  4783.           Init_door  9, 10, 25, 49
  4784.           Init_port  17, 18, 25, 49
  4785.           Initializing
  4786.             ANSI driver  10, 41, 48
  4787.             interrupt handlers  10, 65
  4788.             program  10, 45, 48, 49, 55, 56, 65, 66
  4789.             strings  25, 40, 47
  4790.           Input
  4791.             from com port  18, 25, 31, 63
  4792.             from local & remote  25, 28, 38, 44, 47
  4793.             from local keyboard  25, 45
  4794.           Instatus  23
  4795.           Interrupt handlers
  4796.             BIOS  62, 68
  4797.             communications  17, 50, 60
  4798.             CTRL-Break  10, 50, 62, 66
  4799.           IRQ  9, 14, 23, 55, 65
  4800.           Iscd  25, 50
  4801.           Keyboard  28, 38, 44, 45, 47
  4802.             timeout  28, 47
  4803.           Last date user was on  22
  4804.           Last name  22
  4805.           Last new files scan  22
  4806.           Last_new  22
  4807.           Lastdate  22
  4808.           Leave  10, 25, 50
  4809.           Level  21
  4810.           Line feed  24
  4811.           Lines  23, 51, 52
  4812.           Linking  11
  4813.           Lname  22
  4814.           Local  16, 21
  4815.             Functions
  4816.  
  4817.  
  4818.  
  4819.                                        Page 84
  4820.  
  4821.  
  4822.  
  4823.           GAP Communications                                         GAPCDR
  4824.  
  4825.  
  4826.               cls  25, 30
  4827.               cls_all  25, 30
  4828.               cursoff  25, 33
  4829.               curson  25, 34
  4830.               getkeyc  25, 45
  4831.               lputc  25, 51
  4832.               lputs  25, 51
  4833.           Local mode  11, 16
  4834.           Lowercase characters  23, 47
  4835.           Lputc  25, 51
  4836.           Lputs  25, 51
  4837.           Maindir  24
  4838.           Make_sound  25
  4839.           Maxbytes  22
  4840.           Maxfiles  21
  4841.           Maximum bytes available  22
  4842.           Maximum files available  21
  4843.           Mesleft  22
  4844.           Messages left  22
  4845.           Minsleft  21
  4846.           Minutes left at door start  21
  4847.           More prompt  23, 25, 51
  4848.           Multi  11, 21
  4849.           Multi user  11, 15, 27
  4850.           Name of the BBS  24
  4851.           NL  25, 52, 70
  4852.           No clock  23
  4853.           No_carrier  16, 17, 25, 52
  4854.           Node  21
  4855.           Node number  21
  4856.           Non Stop mode  23
  4857.           Normal  23
  4858.           Noup  23, 47
  4859.           Novice  21
  4860.           NS  23, 51
  4861.           Number of downloads  22
  4862.           Number of times on  22
  4863.           Output
  4864.             to com port  18, 25, 32, 33
  4865.             to local & remote  25, 26, 42, 43, 70
  4866.             to local screen  25, 51
  4867.           Page  21
  4868.           Page bell  15, 21, 53
  4869.           Page length  21, 51
  4870.           Pagesysop  25, 53
  4871.           Parity  21
  4872.           Pascal
  4873.             function calling  12
  4874.  
  4875.  
  4876.  
  4877.                                        Page 85
  4878.  
  4879.  
  4880.  
  4881.           GAP Communications                                         GAPCDR
  4882.  
  4883.  
  4884.           Password  22
  4885.           Path to DOOR.SYS  24
  4886.           Pause  25, 53
  4887.           Pausing  71
  4888.           PCBOARD.SYS  13
  4889.           PKUNZIP  18
  4890.           Port  16, 17, 21, 55, 65
  4891.           Printer  21
  4892.           Printf  11
  4893.           Prompts
  4894.             more  51
  4895.             pause  53
  4896.           Putkey  25, 54
  4897.           Quick C  12
  4898.           Random number generator  10, 25, 46
  4899.           Read_cnf  9, 10, 25, 55
  4900.           Read_doorsys  26, 56
  4901.           Read_gapuser  11, 26, 57
  4902.           Read_pcbsys  11, 26, 57
  4903.           Read_pcbuser  26, 58
  4904.           Read_score  26, 59
  4905.           Realcredit  21
  4906.           Receive buffer  28, 29, 31, 63, 65
  4907.           Recnum  22
  4908.           Redisplay  23
  4909.           Remote user  21
  4910.           Remote user's bps rate  21
  4911.           Reset_port  17, 26, 60
  4912.           Rest_cbreak  26, 62
  4913.           Rest_int10  26, 62
  4914.           Restore_screen  26, 61
  4915.           Rts  26, 63
  4916.           Rxempty  26, 63
  4917.           Save_screen  26, 64
  4918.           Scan codes  45
  4919.           Scoreboard  59, 78
  4920.           Screen  21, 61, 64
  4921.             clearing  29, 30
  4922.             color  45, 51, 66
  4923.             cursor  33, 34
  4924.             full  51
  4925.           Set_attr  26, 66
  4926.           Set_cbreak  26, 66
  4927.           Set_cord  26, 67
  4928.           Set_int10  26, 68
  4929.           Set_status  26, 68
  4930.           Setport  17, 26, 65
  4931.           Shell to DOS  15
  4932.  
  4933.  
  4934.  
  4935.                                        Page 86
  4936.  
  4937.  
  4938.  
  4939.           GAP Communications                                         GAPCDR
  4940.  
  4941.  
  4942.           Show_file  26, 69
  4943.           Show_mess  26, 43, 70
  4944.           Single user  11, 21
  4945.           Starttime  23
  4946.           Status line
  4947.             displaying  15, 23, 68
  4948.             protected  15
  4949.           Strings
  4950.             initializing  25, 40, 47
  4951.             receiving from local & remote  25, 40, 47
  4952.             removing spaces from  73
  4953.             sending to com port  25, 33
  4954.             sending to local & remote  25, 43, 70
  4955.             sending to local screen  25, 51
  4956.           Strtime  24
  4957.           Structures  24
  4958.           Subscrip  22
  4959.           Sysname  24
  4960.           Sysop
  4961.             batch file  14
  4962.             function keys  15
  4963.             functions  13, 15
  4964.             setup  13
  4965.           Sysop's name  24
  4966.           System files  13, 57, 58, 75, 76, 77
  4967.           Temptime  23
  4968.           Time  23
  4969.           Time credits  21, 72
  4970.           Time door opened  23
  4971.           Time slice  16, 28, 31, 37, 38, 39
  4972.           Time user has left  23, 39, 44, 73
  4973.           Time_credit  26, 72
  4974.           Time_left  26, 73
  4975.           Timecredit  13, 23
  4976.           Timeleft  23, 28, 44, 73
  4977.           Timenow  23
  4978.           Timeout  28
  4979.           Timer  16, 26, 71
  4980.           Timeson  22
  4981.           Total uploads  22
  4982.           Trim  26, 73
  4983.           Twit  15
  4984.           Upbytes  22
  4985.           Update_clock  26, 74
  4986.           Updating status line  23
  4987.           Upload bytes  22
  4988.           Uploads  22
  4989.           Uppercase characters  23, 47
  4990.  
  4991.  
  4992.  
  4993.                                        Page 87
  4994.  
  4995.  
  4996.  
  4997.           GAP Communications                                         GAPCDR
  4998.  
  4999.  
  5000.           Usemore1  23
  5001.           User Record  24
  5002.           User's birth date  24
  5003.           User's business phone  22
  5004.           User's first name  22
  5005.           User's full name  22
  5006.           User's Handle  22
  5007.           User's home phone  22
  5008.           User's home town  22
  5009.           User's last name  22
  5010.           User's password  22
  5011.           User's record number  22
  5012.           User's security level  21
  5013.           Userbaud  21
  5014.           Username  22
  5015.           Variables
  5016.             ANSI  8, 20
  5017.             Defines
  5018.               NO  20
  5019.               YES  20
  5020.             DOOR.SYS
  5021.               alarm  21
  5022.               baud  16, 21
  5023.               bell  21
  5024.               bphone  22
  5025.               city  22
  5026.               color  21
  5027.               curbytes  22
  5028.               curfiles  21
  5029.               dflt_color  21
  5030.               doors_open  22
  5031.               downbytes  22
  5032.               downloads  22
  5033.               event_time  22
  5034.               expert  21
  5035.               fname  22
  5036.               handle  22
  5037.               hphone  22
  5038.               last_new  22
  5039.               lastdate  22
  5040.               level  21
  5041.               lname  22
  5042.               local  16, 21
  5043.               maxbytes  22
  5044.               maxfiles  21
  5045.               mesleft  22
  5046.               minsleft  21
  5047.               multi  11, 21
  5048.  
  5049.  
  5050.  
  5051.                                        Page 88
  5052.  
  5053.  
  5054.  
  5055.           GAP Communications                                         GAPCDR
  5056.  
  5057.  
  5058.               node  21
  5059.               page  21
  5060.               parity  21
  5061.               password  22
  5062.               port  16, 17, 21
  5063.               printer  21
  5064.               realcredit  21
  5065.               recnum  22
  5066.               screen  21
  5067.               subscrip  22
  5068.               timeson  22
  5069.               upbytes  22
  5070.               uploads  22
  5071.               userbaud  21
  5072.               username  22
  5073.             Global
  5074.               anystring  24
  5075.               base_add  23
  5076.               bbs_dir  24
  5077.               birthday  24
  5078.               board_name  24
  5079.               BS  24
  5080.               chat  23
  5081.               clockon  23
  5082.               column  23
  5083.               CRLF  24, 43
  5084.               curtime  24
  5085.               endview  23
  5086.               flag  23
  5087.               gendir  24
  5088.               gotdv  16
  5089.               instatus  23
  5090.               IRQ  23
  5091.               lines  23
  5092.               maindir  24
  5093.               normal  23
  5094.               noup  23, 47
  5095.               NS  23
  5096.               redisplay  23
  5097.               starttime  23
  5098.               strtime  24
  5099.               sysname  24
  5100.               temptime  23
  5101.               timecredit  13, 23
  5102.               timeleft  23
  5103.               timenow  23
  5104.               usemore1  23
  5105.               view  23
  5106.  
  5107.  
  5108.  
  5109.                                        Page 89
  5110.  
  5111.  
  5112.  
  5113.           GAP Communications                                         GAPCDR
  5114.  
  5115.  
  5116.               wordwrap  23
  5117.             Structures
  5118.               pcbsys  24
  5119.               pcbuser  24
  5120.               user  24
  5121.           View  23
  5122.           Window  18, 61, 62, 64, 66, 67, 68
  5123.           Wordwrap  23, 54, 74
  5124.           Wrap_word  26, 74
  5125.           Write_gapuser  26, 75
  5126.           Write_pcbsys  26, 76
  5127.           Write_pcbuser  26, 77
  5128.           Write_score  26, 78
  5129.  
  5130.  
  5131.  
  5132.  
  5133.  
  5134.  
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.  
  5156.  
  5157.  
  5158.  
  5159.  
  5160.  
  5161.  
  5162.  
  5163.  
  5164.  
  5165.  
  5166.  
  5167.                                        Page 90